protected ContainerBuilder::shareService(Definition $definition, $service, $id)
Direct copy of the parent function.
Overrides ContainerBuilder::shareService
File
- core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php, line 51
Class
- ContainerBuilder
- Drupal's dependency injection container builder.
Namespace
Drupal\Core\DependencyInjection
Code
protected function shareService(Definition $definition, $service, $id) { if ($definition->isShared() && self::SCOPE_PROTOTYPE !== $scope = $definition->getScope(false)) { if (self::SCOPE_CONTAINER !== $scope && !isset($this->scopedServices[$scope])) { throw new InactiveScopeException($id, $scope); } $this->services[$lowerId = strtolower($id)] = $service; if (self::SCOPE_CONTAINER !== $scope) { $this->scopedServices[$scope][$lowerId] = $service; } } }
Please login to continue.