function DrupalKernel::setContainer
Same name in other branches
- 9 core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::setContainer()
- 8.9.x core/lib/Drupal/Core/DrupalKernel.php \Drupal\Core\DrupalKernel::setContainer()
phpcs:ignore Drupal.Commenting.FunctionComment.VoidReturn phpcs:ignore Drupal.Commenting.FunctionComment.InvalidReturnVoid
Return value
void
File
-
core/
lib/ Drupal/ Core/ DrupalKernel.php, line 560
Class
- DrupalKernel
- The DrupalKernel class is the core of Drupal itself.
Namespace
Drupal\CoreCode
public function setContainer(?ContainerInterface $container = NULL) {
if (isset($this->container)) {
throw new \Exception('The container should not override an existing container.');
}
if ($this->booted) {
throw new \Exception('The container cannot be set after a booted kernel.');
}
$this->container = $container;
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.