Symfony\Component\DependencyInjection\ContainerInterface::get
Gets a service.
Signature
public function get(string
$id,
[int
$invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE] )
Parameters
$id
—
string
- The service identifier
$invalidBehavior
—
int
- The behavior when the service does not exist
Returns
- The associated service
Errors/Exceptions
-
InvalidArgumentException
- if the service is not defined
-
ServiceCircularReferenceException
- When a circular reference is detected
-
ServiceNotFoundException
- When the service is not defined