Total Complexity | 5 |
Total Lines | 41 |
Duplicated Lines | 0 % |
Coverage | 75% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class ContainerConfig |
||
8 | { |
||
9 | /** @var array<mixed> */ |
||
10 | private array $config; |
||
11 | |||
12 | /** |
||
13 | * @param array<mixed> $config |
||
14 | */ |
||
15 | 22 | public function __construct(array $config) |
|
16 | { |
||
17 | 22 | $this->config = $config; |
|
18 | 22 | } |
|
19 | |||
20 | /** |
||
21 | * @return mixed |
||
22 | */ |
||
23 | 22 | public function get(string $id) |
|
24 | { |
||
25 | 22 | return $this->config[$id]; |
|
26 | } |
||
27 | |||
28 | /** |
||
29 | * @param int|string $id |
||
30 | * @return bool |
||
31 | */ |
||
32 | 22 | public function has($id): bool |
|
33 | { |
||
34 | 22 | return array_key_exists($id, $this->config); |
|
35 | } |
||
36 | |||
37 | public function unset(string $id): void |
||
38 | { |
||
39 | unset($this->config[$id]); |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @param mixed $param |
||
44 | */ |
||
45 | 2 | public function set(string $id, $param): void |
|
48 | 2 | } |
|
49 | } |
||
50 |