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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 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.