1 | <?php |
||
10 | final class ApplicationConfig implements ArrayAccess, IteratorAggregate |
||
11 | { |
||
12 | /** |
||
13 | * @var array |
||
14 | */ |
||
15 | private $config; |
||
16 | |||
17 | /** |
||
18 | * @var string |
||
19 | */ |
||
20 | private $separator; |
||
21 | |||
22 | /** |
||
23 | * @param array $config |
||
24 | * @param string $separator |
||
25 | */ |
||
26 | public function __construct(array $config, $separator = '.') |
||
33 | |||
34 | public function merge(array $config) |
||
38 | |||
39 | /** |
||
40 | * @param string $separator |
||
41 | * |
||
42 | * @return void |
||
43 | */ |
||
44 | public function setSeparator($separator) |
||
50 | |||
51 | public function getIterator() |
||
55 | |||
56 | /** |
||
57 | * @return array<int|string> |
||
58 | */ |
||
59 | public function getKeys() |
||
63 | |||
64 | public function offsetExists($offset) |
||
74 | |||
75 | /** |
||
76 | * @throws EntryDoesNotExistException |
||
77 | */ |
||
78 | public function offsetGet($offset) |
||
82 | |||
83 | /** |
||
84 | * @throws ReadOnlyException |
||
85 | */ |
||
86 | public function offsetSet($offset, $value) |
||
90 | |||
91 | /** |
||
92 | * @throws ReadOnlyException |
||
93 | */ |
||
94 | public function offsetUnset($offset) |
||
98 | |||
99 | /** |
||
100 | * @return array |
||
101 | */ |
||
102 | public function asArray() |
||
106 | |||
107 | /** |
||
108 | * @return string |
||
109 | */ |
||
110 | public function getSeparator() |
||
114 | |||
115 | private function getPath($offset) |
||
119 | |||
120 | /** |
||
121 | * @return mixed |
||
122 | * |
||
123 | * @throws EntryDoesNotExistException |
||
124 | */ |
||
125 | private function traverseConfig(array $path) |
||
139 | } |
||
140 |