interface ContainerInterface
Same name in this branch
- 11.1.x vendor/symfony/dependency-injection/ContainerInterface.php \Symfony\Component\DependencyInjection\ContainerInterface
- 11.1.x core/lib/Drupal/Component/DependencyInjection/ContainerInterface.php \Drupal\Component\DependencyInjection\ContainerInterface
Describes the interface of a container that exposes methods to read its entries.
Hierarchy
- interface \Psr\Container\ContainerInterface
Expanded class hierarchy of ContainerInterface
All classes that implement ContainerInterface
28 files declare their use of ContainerInterface
- AbstractSessionListener.php in vendor/
symfony/ http-kernel/ EventListener/ AbstractSessionListener.php - ArgumentResolver.php in vendor/
symfony/ http-kernel/ Controller/ ArgumentResolver.php - CacheFactory.php in core/
lib/ Drupal/ Core/ Cache/ CacheFactory.php - ChainedFastBackendFactory.php in core/
lib/ Drupal/ Core/ Cache/ ChainedFastBackendFactory.php - CheckProvider.php in core/
lib/ Drupal/ Core/ Access/ CheckProvider.php
File
-
vendor/
psr/ container/ src/ ContainerInterface.php, line 10
Namespace
Psr\ContainerView source
interface ContainerInterface {
/**
* Finds an entry of the container by its identifier and returns it.
*
* @param string $id Identifier of the entry to look for.
*
* @throws NotFoundExceptionInterface No entry was found for **this** identifier.
* @throws ContainerExceptionInterface Error while retrieving the entry.
*
* @return mixed Entry.
*/
public function get(string $id);
/**
* 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`.
*
* @param string $id Identifier of the entry to look for.
*
* @return bool
*/
public function has(string $id) : bool;
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overrides |
---|---|---|---|---|
ContainerInterface::get | public | function | Finds an entry of the container by its identifier and returns it. | 2 |
ContainerInterface::has | public | function | Returns true if the container can return an entry for the given identifier. Returns false otherwise. |
2 |