| Conditions | 1 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | protected function getContainer(array $definitions = []): ContainerInterface |
||
| 14 | { |
||
| 15 | return new class($definitions) implements ContainerInterface { |
||
| 16 | private array $definitions; |
||
| 17 | public function __construct(array $definitions = []) |
||
| 18 | { |
||
| 19 | $this->definitions = $definitions; |
||
| 20 | } |
||
| 21 | public function get($id) |
||
| 22 | { |
||
| 23 | if (!$this->has($id)) { |
||
| 24 | throw new class() extends \Exception implements NotFoundExceptionInterface { |
||
| 25 | }; |
||
| 26 | } |
||
| 27 | return $this->definitions[$id]; |
||
| 28 | } |
||
| 29 | public function has($id) |
||
| 30 | { |
||
| 31 | return array_key_exists($id, $this->definitions); |
||
| 32 | } |
||
| 36 |