Loading core/lib/Drupal/Component/DependencyInjection/Container.php +7 −7 Changes for core/lib/Drupal/Component/DependencyInjection/Container.php: 7 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -127,7 +127,7 @@ public function __construct(array $container_definition = []) { /** * {@inheritdoc} */ public function get($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) { public function get($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE): ?object { if ($this->hasParameter('_deprecated_service_list')) { if ($deprecation = $this->getParameter('_deprecated_service_list')[$id] ?? '') { @trigger_error($deprecation, E_USER_DEPRECATED); Loading Loading @@ -160,7 +160,7 @@ public function get($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_IN // is used, the actual wanted behavior is to re-try getting the service at a // later point. if (!$definition) { return; return NULL; } // Definition is a keyed array, so [0] is only defined when it is a Loading @@ -180,7 +180,7 @@ public function get($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_IN unset($this->services[$id]); if (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $invalid_behavior) { return; return NULL; } throw $e; Loading Loading @@ -315,14 +315,14 @@ public function set($id, $service) { /** * {@inheritdoc} */ public function has($id) { public function has($id): bool { return isset($this->aliases[$id]) || isset($this->services[$id]) || isset($this->serviceDefinitions[$id]); } /** * {@inheritdoc} */ public function getParameter($name) { public function getParameter($name): array|bool|string|int|float|NULL { if (!(isset($this->parameters[$name]) || array_key_exists($name, $this->parameters))) { if (!$name) { throw new ParameterNotFoundException(''); Loading @@ -337,7 +337,7 @@ public function getParameter($name) { /** * {@inheritdoc} */ public function hasParameter($name) { public function hasParameter($name): bool { return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters); } Loading @@ -355,7 +355,7 @@ public function setParameter($name, $value) { /** * {@inheritdoc} */ public function initialized($id) { public function initialized($id): bool { if (isset($this->aliases[$id])) { $id = $this->aliases[$id]; } Loading core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php +2 −1 Changes for core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Drupal\FunctionalTests\Bootstrap; use Drupal\Core\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Container base class which triggers an error. Loading @@ -12,7 +13,7 @@ class ErrorContainer extends Container { /** * {@inheritdoc} */ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) { public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE): ?object { if ($id === 'http_kernel') { // Enforce a recoverable error. $callable = function (ErrorContainer $container) { Loading core/tests/Drupal/FunctionalTests/Bootstrap/ExceptionContainer.php +2 −1 Changes for core/tests/Drupal/FunctionalTests/Bootstrap/ExceptionContainer.php: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Drupal\FunctionalTests\Bootstrap; use Drupal\Core\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Base container which throws an exception. Loading @@ -12,7 +13,7 @@ class ExceptionContainer extends Container { /** * {@inheritdoc} */ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) { public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE): ?object { if ($id === 'http_kernel') { throw new \Exception('Thrown exception during Container::get'); } Loading Loading
core/lib/Drupal/Component/DependencyInjection/Container.php +7 −7 Changes for core/lib/Drupal/Component/DependencyInjection/Container.php: 7 added lines, 7 removed lines. Original line number Diff line number Diff line Loading @@ -127,7 +127,7 @@ public function __construct(array $container_definition = []) { /** * {@inheritdoc} */ public function get($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) { public function get($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE): ?object { if ($this->hasParameter('_deprecated_service_list')) { if ($deprecation = $this->getParameter('_deprecated_service_list')[$id] ?? '') { @trigger_error($deprecation, E_USER_DEPRECATED); Loading Loading @@ -160,7 +160,7 @@ public function get($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_IN // is used, the actual wanted behavior is to re-try getting the service at a // later point. if (!$definition) { return; return NULL; } // Definition is a keyed array, so [0] is only defined when it is a Loading @@ -180,7 +180,7 @@ public function get($id, $invalid_behavior = ContainerInterface::EXCEPTION_ON_IN unset($this->services[$id]); if (ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE !== $invalid_behavior) { return; return NULL; } throw $e; Loading Loading @@ -315,14 +315,14 @@ public function set($id, $service) { /** * {@inheritdoc} */ public function has($id) { public function has($id): bool { return isset($this->aliases[$id]) || isset($this->services[$id]) || isset($this->serviceDefinitions[$id]); } /** * {@inheritdoc} */ public function getParameter($name) { public function getParameter($name): array|bool|string|int|float|NULL { if (!(isset($this->parameters[$name]) || array_key_exists($name, $this->parameters))) { if (!$name) { throw new ParameterNotFoundException(''); Loading @@ -337,7 +337,7 @@ public function getParameter($name) { /** * {@inheritdoc} */ public function hasParameter($name) { public function hasParameter($name): bool { return isset($this->parameters[$name]) || array_key_exists($name, $this->parameters); } Loading @@ -355,7 +355,7 @@ public function setParameter($name, $value) { /** * {@inheritdoc} */ public function initialized($id) { public function initialized($id): bool { if (isset($this->aliases[$id])) { $id = $this->aliases[$id]; } Loading
core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php +2 −1 Changes for core/tests/Drupal/FunctionalTests/Bootstrap/ErrorContainer.php: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Drupal\FunctionalTests\Bootstrap; use Drupal\Core\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Container base class which triggers an error. Loading @@ -12,7 +13,7 @@ class ErrorContainer extends Container { /** * {@inheritdoc} */ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) { public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE): ?object { if ($id === 'http_kernel') { // Enforce a recoverable error. $callable = function (ErrorContainer $container) { Loading
core/tests/Drupal/FunctionalTests/Bootstrap/ExceptionContainer.php +2 −1 Changes for core/tests/Drupal/FunctionalTests/Bootstrap/ExceptionContainer.php: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ namespace Drupal\FunctionalTests\Bootstrap; use Drupal\Core\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ContainerInterface; /** * Base container which throws an exception. Loading @@ -12,7 +13,7 @@ class ExceptionContainer extends Container { /** * {@inheritdoc} */ public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) { public function get($id, $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE): ?object { if ($id === 'http_kernel') { throw new \Exception('Thrown exception during Container::get'); } Loading