You are here

class ExceptionContainer in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/src/Tests/Bootstrap/ExceptionContainer.php \Drupal\system\Tests\Bootstrap\ExceptionContainer

Base container which throws an exception.

Hierarchy

Expanded class hierarchy of ExceptionContainer

File

core/modules/system/src/Tests/Bootstrap/ExceptionContainer.php, line 15
Contains \Drupal\system\Tests\Bootstrap\ExceptionContainer.

Namespace

Drupal\system\Tests\Bootstrap
View source
class ExceptionContainer extends Container {

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

}

Members

Namesort descending Modifiers Type Description Overrides
Container::$aliases protected property The aliases of the container.
Container::$frozen protected property Whether the container parameters can still be changed.
Container::$loading protected property The currently loading services.
Container::$parameters protected property The parameters of the container.
Container::$privateServices protected property The instantiated private services.
Container::$serviceDefinitions protected property The service definitions of the container.
Container::$services protected property The instantiated services.
Container::addScope public function Adds a scope to the container. Overrides ContainerInterface::addScope
Container::createService protected function Creates a service from a service definition. 1
Container::enterScope public function Enters the given scope. Overrides ContainerInterface::enterScope
Container::getAlternatives protected function Provides alternatives for a given array and key.
Container::getParameter public function Gets a parameter. Overrides ContainerInterface::getParameter
Container::getParameterAlternatives protected function Provides alternatives in case a parameter was not found.
Container::getServiceAlternatives protected function Provides alternatives in case a service was not found.
Container::getServiceIds public function Gets all defined service IDs.
Container::has public function Returns true if the given service is defined. Overrides ContainerInterface::has
Container::hasParameter public function Checks if a parameter exists. Overrides ContainerInterface::hasParameter
Container::hasScope public function Whether this container has the given scope. Overrides ContainerInterface::hasScope
Container::initialized public function Check for whether or not a service has been initialized. Overrides IntrospectableContainerInterface::initialized
Container::isScopeActive public function Determines whether the given scope is currently active. Overrides ContainerInterface::isScopeActive
Container::leaveScope public function Leaves the current scope, and re-enters the parent scope. Overrides ContainerInterface::leaveScope
Container::resolveServicesAndParameters protected function Resolves arguments that represent services or variables to the real values. 1
Container::set public function Sets a service. Overrides Container::set
Container::setParameter public function Sets a parameter. Overrides ContainerInterface::setParameter
Container::__construct public function Constructs a new Container instance. 1
Container::__sleep public function
ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE constant
ContainerInterface::IGNORE_ON_INVALID_REFERENCE constant
ContainerInterface::NULL_ON_INVALID_REFERENCE constant
ContainerInterface::SCOPE_CONTAINER constant
ContainerInterface::SCOPE_PROTOTYPE constant
ExceptionContainer::get public function Gets a service. Overrides Container::get