function ContainerBuilder::get
Throws
InvalidArgumentException when no definitions are available
ServiceCircularReferenceException When a circular reference is detected
ServiceNotFoundException When the service is not defined
\Exception
Overrides Container::get
See also
File
-
vendor/
symfony/ dependency-injection/ ContainerBuilder.php, line 565
Class
- ContainerBuilder
- ContainerBuilder is a DI container that provides an API to easily describe services.
Namespace
Symfony\Component\DependencyInjectionCode
public function get(string $id, int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) : ?object {
if ($this->isCompiled() && isset($this->removedIds[$id])) {
return ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE >= $invalidBehavior ? parent::get($id) : null;
}
return $this->doGet($id, $invalidBehavior);
}