dee5ffa7a38633f7db9d3e684bbffd361b3a3f75
[GitHub/WoltLab/WCF.git] /
1 <?php
2 /**
3 * @license http://www.opensource.org/licenses/mit-license.php MIT (see the LICENSE file)
4 */
5
6 namespace Interop\Container;
7
8 use Interop\Container\Exception\ContainerException;
9 use Interop\Container\Exception\NotFoundException;
10
11 /**
12 * Describes the interface of a container that exposes methods to read its entries.
13 */
14 interface ContainerInterface
15 {
16 /**
17 * Finds an entry of the container by its identifier and returns it.
18 *
19 * @param string $id Identifier of the entry to look for.
20 *
21 * @throws NotFoundException No entry was found for this identifier.
22 * @throws ContainerException Error while retrieving the entry.
23 *
24 * @return mixed Entry.
25 */
26 public function get($id);
27
28 /**
29 * Returns true if the container can return an entry for the given identifier.
30 * Returns false otherwise.
31 *
32 * @param string $id Identifier of the entry to look for.
33 *
34 * @return boolean
35 */
36 public function has($id);
37 }