1<?php
2
3namespace App\Container;
4
5/**
6 * Describes the interface of a container that exposes methods to read its entries.
7 */
8interface ContainerInterface
9{
10    /**
11     * Finds an entry of the container by its identifier and returns it.
12     *
13     * @param string $id identifier of the entry to look for
14     *
15     * @throws NotFoundExceptionInterface  no entry was found for **this** identifier
16     * @throws ContainerExceptionInterface error while retrieving the entry
17     *
18     * @return mixed entry
19     */
20    public function get(string $id);
21
22    /**
23     * Returns true if the container can return an entry for the given identifier.
24     * Returns false otherwise.
25     *
26     * `has($id)` returning true does not mean that `get($id)` will not throw an exception.
27     * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`.
28     *
29     * @param string $id identifier of the entry to look for
30     *
31     * @return bool
32     */
33    public function has(string $id): bool;
34}
35