| Total Complexity | 6 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | final class Container implements ContainerInterface |
||
| 14 | { |
||
| 15 | private $services; |
||
| 16 | |||
| 17 | 7 | public function __construct(Services $services) |
|
| 20 | 7 | } |
|
| 21 | |||
| 22 | /** |
||
| 23 | * {@inheritdoc} |
||
| 24 | */ |
||
| 25 | 5 | public function get($id): object |
|
| 26 | { |
||
| 27 | 5 | if (!$this->has($id)) { |
|
| 28 | 3 | throw new NotFound($id); |
|
| 29 | } |
||
| 30 | |||
| 31 | 2 | return $this->services->build(new Name($id)); |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * {@inheritdoc} |
||
| 36 | */ |
||
| 37 | 6 | public function has($id): bool |
|
| 54 | } |
||
| 55 | } |
||
| 56 |