Total Complexity | 6 |
Total Lines | 36 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | final class ParameterBag |
||
8 | { |
||
9 | protected array $parameters; |
||
10 | |||
11 | 62 | public function __construct(array $parameters = []) |
|
12 | { |
||
13 | 62 | $this->parameters = $parameters; |
|
14 | 62 | } |
|
15 | |||
16 | 2 | public function get(string $key):? string |
|
17 | { |
||
18 | 2 | return $this->parameters[$key] ?? null; |
|
19 | } |
||
20 | |||
21 | 6 | public function has(string $key): bool |
|
22 | { |
||
23 | 6 | return array_key_exists($key, $this->parameters); |
|
24 | } |
||
25 | |||
26 | 2 | public function set(string $key, string $value): self |
|
27 | { |
||
28 | 2 | $this->parameters[$key] = $value; |
|
29 | |||
30 | 2 | return $this; |
|
31 | } |
||
32 | |||
33 | 2 | public function remove(string $key): self |
|
38 | } |
||
39 | |||
40 | 6 | public function all(): array |
|
43 | } |
||
44 | } |
||
45 |