function ErrorContainer::get

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php \Drupal\FunctionalTests\Bootstrap\ErrorContainer::get()
  2. 8.9.x core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php \Drupal\FunctionalTests\Bootstrap\ErrorContainer::get()
  3. 11.x core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php \Drupal\FunctionalTests\Bootstrap\ErrorContainer::get()

Overrides Container::get

File

core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php, line 18

Class

ErrorContainer
Container base class which triggers an error.

Namespace

Drupal\FunctionalTests\Bootstrap

Code

public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) : ?object {
    if ($id === 'http_kernel') {
        // Enforce a recoverable error.
        $callable = function (ErrorContainer $container) {
        };
        return $callable(1);
    }
    return parent::get($id, $invalidBehavior);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.