3 * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
6 namespace Psr\Container;
9 * Describes the interface of a container that exposes methods to read its entries.
11 interface ContainerInterface
14 * Finds an entry of the container by its identifier and returns it.
16 * @param string $id Identifier of the entry to look for.
18 * @throws NotFoundExceptionInterface No entry was found for **this** identifier.
19 * @throws ContainerExceptionInterface Error while retrieving the entry.
21 * @return mixed Entry.
23 public function get($id);
26 * Returns true if the container can return an entry for the given identifier.
27 * Returns false otherwise.
29 * `has($id)` returning true does not mean that `get($id)` will not throw an exception.
30 * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`.
32 * @param string $id Identifier of the entry to look for.
36 public function has($id);