function ContainerInterface::get
Same name in this branch
- 11.1.x vendor/psr/container/src/ContainerInterface.php \Psr\Container\ContainerInterface::get()
@template B of self::*_REFERENCE
@psalm-return (B is self::EXCEPTION_ON_INVALID_REFERENCE|self::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE ? object : object|null)
Parameters
B $invalidBehavior:
Throws
ServiceCircularReferenceException When a circular reference is detected
ServiceNotFoundException When the service is not defined
Overrides ContainerInterface::get
See also
2 methods override ContainerInterface::get()
- Container::get in core/
lib/ Drupal/ Component/ DependencyInjection/ Container.php - @template B of self::*_REFERENCE
- Container::get in vendor/
symfony/ dependency-injection/ Container.php - Gets a service.
File
-
vendor/
symfony/ dependency-injection/ ContainerInterface.php, line 47
Class
- ContainerInterface
- ContainerInterface is the interface implemented by service container classes.
Namespace
Symfony\Component\DependencyInjectionCode
public function get(string $id, int $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE) : ?object;