You are here

class ErrorContainer in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php \Drupal\FunctionalTests\Bootstrap\ErrorContainer
  2. 9 core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php \Drupal\FunctionalTests\Bootstrap\ErrorContainer

Container base class which triggers an error.

Hierarchy

  • class \Drupal\FunctionalTests\Bootstrap\ErrorContainer extends \Drupal\Core\DependencyInjection\Container

Expanded class hierarchy of ErrorContainer

File

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

Namespace

Drupal\FunctionalTests\Bootstrap
View source
class ErrorContainer extends Container {

  /**
   * {@inheritdoc}
   */
  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);
  }

}

Members