You are here

class ExceptionContainer in Drupal 10

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

Base container which throws an exception.

Hierarchy

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

Expanded class hierarchy of ExceptionContainer

File

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

Namespace

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

  /**
   * {@inheritdoc}
   */
  public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) : ?object {
    if ($id === 'http_kernel') {
      throw new \Exception('Thrown exception during Container::get');
    }
    else {
      return parent::get($id, $invalidBehavior);
    }
  }

}

Members