Total Complexity | 6 |
Total Lines | 51 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class ServiceContainer extends Container |
||
10 | { |
||
11 | /** |
||
12 | * @var array $warehouse Services warehouse |
||
13 | */ |
||
14 | private $warehouse = []; |
||
15 | |||
16 | /** |
||
17 | * Set warehouse array |
||
18 | * |
||
19 | * @param array $serviceList warehouse content |
||
20 | * @return ServiceContainer |
||
21 | */ |
||
22 | public function setWarehouse(array $serviceList) |
||
27 | } |
||
28 | |||
29 | public function addToWarehouse(string $serviceName, string $serviceClass) |
||
30 | { |
||
31 | $this->warehouse[$serviceName] = $serviceClass; |
||
32 | } |
||
33 | |||
34 | public function offsetExists($offset): bool |
||
35 | { |
||
36 | return isset($this->warehouse[$offset]); |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * ArrayAccess offsetGet implementation |
||
41 | * |
||
42 | * @param mixed $offset offset to get |
||
43 | * @throws InvalidArgumentException |
||
44 | * @return mixed |
||
45 | */ |
||
46 | public function offsetGet($offset) |
||
60 | } |
||
61 | } |
||
62 |