| Total Complexity | 4 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class Container implements ContainerInterface |
||
| 9 | { |
||
| 10 | private array $instances; |
||
| 11 | |||
| 12 | public function __construct(array $instances) |
||
| 15 | } |
||
| 16 | |||
| 17 | public function get($id) |
||
| 18 | { |
||
| 19 | if ($this->has($id)) { |
||
| 20 | return $this->instances[$id]; |
||
| 21 | } |
||
| 22 | |||
| 23 | throw new NotFoundException("$id was not found in container"); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function has($id) |
||
| 29 | } |
||
| 30 | } |
||
| 31 |