Total Complexity | 4 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
15 | class StaticServiceProvider implements ContainerInterface |
||
16 | { |
||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | private $instances = []; |
||
21 | |||
22 | public function set($id, $instance): StaticServiceProvider |
||
23 | { |
||
24 | $this->instances[$id] = $instance; |
||
25 | |||
26 | return $this; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * {@inheritdoc} |
||
31 | */ |
||
32 | public function get($id) |
||
33 | { |
||
34 | return $this->instances[$id] ?? null; |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | public function has($id) |
||
43 | } |
||
44 | } |
||
45 |