Total Complexity | 9 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
8 | final class Config |
||
9 | { |
||
10 | private $data = []; |
||
11 | |||
12 | /** |
||
13 | * @param mixed $value |
||
14 | */ |
||
15 | public function set(string $name, $value): self |
||
16 | { |
||
17 | $this->data[$name] = $value; |
||
18 | |||
19 | return $this; |
||
20 | } |
||
21 | |||
22 | /** |
||
23 | * @param mixed $default |
||
24 | * |
||
25 | * @return mixed |
||
26 | */ |
||
27 | public function get(string $name, $default = null) |
||
28 | { |
||
29 | return $this->data[$name] ?? $default; |
||
30 | } |
||
31 | |||
32 | public function all(): array |
||
33 | { |
||
34 | return $this->data; |
||
35 | } |
||
36 | |||
37 | public function humanized(): array |
||
64 | } |
||
65 | } |
||
66 |