You are here

class ErrorContainer in Drupal 8

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

Container base class which triggers an error.

Hierarchy

  • class \Drupal\Component\DependencyInjection\Container implements \Symfony\Component\DependencyInjection\ContainerInterface

Expanded class hierarchy of ErrorContainer

File

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

Namespace

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

  /**
   * {@inheritdoc}
   */
  public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) {
    if ($id === 'http_kernel') {

      // Enforce a recoverable error.
      $callable = function (ErrorContainer $container) {
      };
      $callable(1);
    }
    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::createService protected function Creates a service from a service definition. 1
Container::getAlternatives protected function Provides alternatives for a given array and key.
Container::getParameter public function Gets a parameter.
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.
Container::hasParameter public function Checks if a parameter exists.
Container::initialized public function
Container::reset public function Resets shared services from the container.
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.
Container::__clone private function Ensure that cloning doesn't work.
Container::__construct public function Constructs a new Container instance. 1
Container::__sleep public function
ErrorContainer::get public function Gets a service. Overrides Container::get