Loading core/lib/Drupal/Core/Ajax/AjaxResponseAttachmentsProcessor.php +1 −4 Original line number Diff line number Diff line Loading @@ -109,10 +109,7 @@ public function __construct(AssetResolverInterface $asset_resolver, ConfigFactor * {@inheritdoc} */ public function processAttachments(AttachmentsInterface $response) { // @todo Convert to assertion once https://www.drupal.org/node/2408013 lands if (!$response instanceof AjaxResponse) { throw new \InvalidArgumentException('\Drupal\Core\Ajax\AjaxResponse instance expected.'); } assert($response instanceof AjaxResponse, '\Drupal\Core\Ajax\AjaxResponse instance expected.'); $request = $this->requestStack->getCurrentRequest(); Loading core/lib/Drupal/Core/Entity/ContentEntityBase.php +3 −7 Original line number Diff line number Diff line Loading @@ -439,13 +439,9 @@ public function isTranslatable() { public function preSave(EntityStorageInterface $storage) { // An entity requiring validation should not be saved if it has not been // actually validated. if ($this->validationRequired && !$this->validated) { // @todo Make this an assertion in https://www.drupal.org/node/2408013. throw new \LogicException('Entity validation was skipped.'); } else { assert(!$this->validationRequired || $this->validated, 'Entity validation was skipped.'); $this->validated = FALSE; } parent::preSave($storage); } Loading core/lib/Drupal/Core/Plugin/Context/LazyContextRepository.php +4 −12 Original line number Diff line number Diff line Loading @@ -58,18 +58,10 @@ public function getRuntimeContexts(array $context_ids) { $contexts[$id] = $this->contexts[$id]; continue; } // The IDs have been passed in @{service_id}:{unqualified_context_id} // format. // @todo Convert to an assert once https://www.drupal.org/node/2408013 is // in. if ($id[0] === '@' && strpos($id, ':') !== FALSE) { [$service_id, $unqualified_context_id] = explode(':', $id, 2); assert($id[0] === '@' && strpos($id, ':'), 'You must provide the context IDs in the @{service_id}:{unqualified_context_id} format.'); list($service_id, $unqualified_context_id) = explode(':', $id, 2); // Remove the leading '@'. $service_id = substr($service_id, 1); } else { throw new \InvalidArgumentException('You must provide the context IDs in the @{service_id}:{unqualified_context_id} format.'); } $context_ids_by_service[$service_id][] = $unqualified_context_id; } Loading core/lib/Drupal/Core/Render/Renderer.php +1 −4 Original line number Diff line number Diff line Loading @@ -580,10 +580,7 @@ public function executeInRenderContext(RenderContext $context, callable $callabl // Set the provided context and call the callable, it will use that context. $this->setCurrentRenderContext($context); $result = $callable(); // @todo Convert to an assertion in https://www.drupal.org/node/2408013 if ($context->count() > 1) { throw new \LogicException('Bubbling failed.'); } assert($context->count() <= 1, 'Bubbling failed.'); // Restore the original render context. $this->setCurrentRenderContext($previous_context); Loading core/modules/system/tests/modules/entity_test/src/EntityTestForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ public function save(array $form, FormStateInterface $form_state) { $form_state->setRebuild(); } } catch (\Exception $e) { catch (\AssertionError $e) { \Drupal::state()->set('entity_test.form.save.exception', get_class($e) . ': ' . $e->getMessage()); } return $status ?? FALSE; Loading Loading
core/lib/Drupal/Core/Ajax/AjaxResponseAttachmentsProcessor.php +1 −4 Original line number Diff line number Diff line Loading @@ -109,10 +109,7 @@ public function __construct(AssetResolverInterface $asset_resolver, ConfigFactor * {@inheritdoc} */ public function processAttachments(AttachmentsInterface $response) { // @todo Convert to assertion once https://www.drupal.org/node/2408013 lands if (!$response instanceof AjaxResponse) { throw new \InvalidArgumentException('\Drupal\Core\Ajax\AjaxResponse instance expected.'); } assert($response instanceof AjaxResponse, '\Drupal\Core\Ajax\AjaxResponse instance expected.'); $request = $this->requestStack->getCurrentRequest(); Loading
core/lib/Drupal/Core/Entity/ContentEntityBase.php +3 −7 Original line number Diff line number Diff line Loading @@ -439,13 +439,9 @@ public function isTranslatable() { public function preSave(EntityStorageInterface $storage) { // An entity requiring validation should not be saved if it has not been // actually validated. if ($this->validationRequired && !$this->validated) { // @todo Make this an assertion in https://www.drupal.org/node/2408013. throw new \LogicException('Entity validation was skipped.'); } else { assert(!$this->validationRequired || $this->validated, 'Entity validation was skipped.'); $this->validated = FALSE; } parent::preSave($storage); } Loading
core/lib/Drupal/Core/Plugin/Context/LazyContextRepository.php +4 −12 Original line number Diff line number Diff line Loading @@ -58,18 +58,10 @@ public function getRuntimeContexts(array $context_ids) { $contexts[$id] = $this->contexts[$id]; continue; } // The IDs have been passed in @{service_id}:{unqualified_context_id} // format. // @todo Convert to an assert once https://www.drupal.org/node/2408013 is // in. if ($id[0] === '@' && strpos($id, ':') !== FALSE) { [$service_id, $unqualified_context_id] = explode(':', $id, 2); assert($id[0] === '@' && strpos($id, ':'), 'You must provide the context IDs in the @{service_id}:{unqualified_context_id} format.'); list($service_id, $unqualified_context_id) = explode(':', $id, 2); // Remove the leading '@'. $service_id = substr($service_id, 1); } else { throw new \InvalidArgumentException('You must provide the context IDs in the @{service_id}:{unqualified_context_id} format.'); } $context_ids_by_service[$service_id][] = $unqualified_context_id; } Loading
core/lib/Drupal/Core/Render/Renderer.php +1 −4 Original line number Diff line number Diff line Loading @@ -580,10 +580,7 @@ public function executeInRenderContext(RenderContext $context, callable $callabl // Set the provided context and call the callable, it will use that context. $this->setCurrentRenderContext($context); $result = $callable(); // @todo Convert to an assertion in https://www.drupal.org/node/2408013 if ($context->count() > 1) { throw new \LogicException('Bubbling failed.'); } assert($context->count() <= 1, 'Bubbling failed.'); // Restore the original render context. $this->setCurrentRenderContext($previous_context); Loading
core/modules/system/tests/modules/entity_test/src/EntityTestForm.php +1 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ public function save(array $form, FormStateInterface $form_state) { $form_state->setRebuild(); } } catch (\Exception $e) { catch (\AssertionError $e) { \Drupal::state()->set('entity_test.form.save.exception', get_class($e) . ': ' . $e->getMessage()); } return $status ?? FALSE; Loading