function ContainerInterface::has
Same name in this branch
- 11.1.x vendor/symfony/dependency-injection/ContainerInterface.php \Symfony\Component\DependencyInjection\ContainerInterface::has()
Returns true if the container can return an entry for the given identifier. Returns false otherwise.
`has($id)` returning true does not mean that `get($id)` will not throw an exception. It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`.
Parameters
string $id Identifier of the entry to look for.:
Return value
bool
2 methods override ContainerInterface::has()
- ContainerInterface::has in vendor/
symfony/ dependency-injection/ ContainerInterface.php - Returns true if the container can return an entry for the given identifier. Returns false otherwise.
- ServiceProviderInterface::has in vendor/
symfony/ service-contracts/ ServiceProviderInterface.php - Returns true if the container can return an entry for the given identifier. Returns false otherwise.
File
-
vendor/
psr/ container/ src/ ContainerInterface.php, line 35
Class
- ContainerInterface
- Describes the interface of a container that exposes methods to read its entries.
Namespace
Psr\ContainerCode
public function has(string $id) : bool;