ContainerExceptionInterface.php
1 year ago
ContainerInterface.php
1 year ago
NotFoundExceptionInterface.php
1 year ago
ContainerInterface.php
43 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @license MIT |
| 4 | * |
| 5 | * Modified by Scott Kingsley Clark on 07-July-2025 using Strauss. |
| 6 | * @see https://github.com/BrianHenryIE/strauss |
| 7 | */ |
| 8 | |
| 9 | declare(strict_types=1); |
| 10 | |
| 11 | namespace Pods\Prefixed\Psr\Container; |
| 12 | |
| 13 | /** |
| 14 | * Describes the interface of a container that exposes methods to read its entries. |
| 15 | */ |
| 16 | interface ContainerInterface |
| 17 | { |
| 18 | /** |
| 19 | * Finds an entry of the container by its identifier and returns it. |
| 20 | * |
| 21 | * @param string $id Identifier of the entry to look for. |
| 22 | * |
| 23 | * @throws NotFoundExceptionInterface No entry was found for **this** identifier. |
| 24 | * @throws ContainerExceptionInterface Error while retrieving the entry. |
| 25 | * |
| 26 | * @return mixed Entry. |
| 27 | */ |
| 28 | public function get(string $id); |
| 29 | |
| 30 | /** |
| 31 | * Returns true if the container can return an entry for the given identifier. |
| 32 | * Returns false otherwise. |
| 33 | * |
| 34 | * `has($id)` returning true does not mean that `get($id)` will not throw an exception. |
| 35 | * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`. |
| 36 | * |
| 37 | * @param string $id Identifier of the entry to look for. |
| 38 | * |
| 39 | * @return bool |
| 40 | */ |
| 41 | public function has(string $id); |
| 42 | } |
| 43 |