Total Complexity | 6 |
Total Lines | 59 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class ApplicationConfig implements \ArrayAccess |
||
6 | { |
||
7 | |||
8 | /** |
||
9 | * @var array |
||
10 | */ |
||
11 | private $config; |
||
12 | |||
13 | /** |
||
14 | * @param array $config |
||
15 | */ |
||
16 | public function __construct(array $config) |
||
17 | { |
||
18 | $this->config = $config; |
||
19 | } |
||
20 | |||
21 | /** |
||
22 | * @return array |
||
23 | */ |
||
24 | public function getData(): array |
||
25 | { |
||
26 | return $this->config; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @param mixed $offset |
||
31 | * |
||
32 | * @return bool |
||
33 | */ |
||
34 | public function offsetExists($offset): bool |
||
35 | { |
||
36 | return isset($this->config[$offset]); |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @param mixed $offset |
||
41 | * |
||
42 | * @return mixed|null |
||
43 | */ |
||
44 | public function offsetGet($offset) |
||
45 | { |
||
46 | return $this->config[$offset] ?? null; |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @param mixed $offset |
||
51 | * @param mixed $value |
||
52 | */ |
||
53 | public function offsetSet($offset, $value) |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @param mixed $offset |
||
60 | */ |
||
61 | public function offsetUnset($offset) |
||
64 | } |
||
65 | } |
||
66 |