1 | <?php |
||
19 | class Config implements ConfigInterface |
||
20 | { |
||
21 | /** @var array */ |
||
22 | private $pathMap = []; |
||
23 | /** @var array */ |
||
24 | private $rawConfig; |
||
25 | |||
26 | /** |
||
27 | * Config constructor. |
||
28 | * |
||
29 | * @param array $config |
||
30 | */ |
||
31 | public function __construct(array $config) |
||
36 | |||
37 | /** |
||
38 | * Processes the config into a one dimensional array. |
||
39 | * |
||
40 | * @param $path |
||
41 | * @param $config |
||
42 | */ |
||
43 | private function processConfig($path, $config) |
||
57 | |||
58 | /** |
||
59 | * Checks whether the key-path does exist or not. |
||
60 | * |
||
61 | * @param string $path |
||
62 | * |
||
63 | * @return bool |
||
64 | */ |
||
65 | public function has($path) |
||
69 | |||
70 | /** |
||
71 | * Retrieves configuration data for a specific key. |
||
72 | * |
||
73 | * @param string $path |
||
74 | * |
||
75 | * @throws InvalidArgumentException |
||
76 | * |
||
77 | * @return mixed |
||
78 | */ |
||
79 | public function getData($path) |
||
87 | |||
88 | /** |
||
89 | * Returns the configuration instance for a specific key. Also add the possibility to merge additional information |
||
90 | * into it. |
||
91 | * |
||
92 | * @param string $path |
||
93 | * |
||
94 | * @throws InvalidArgumentException |
||
95 | * |
||
96 | * @return mixed |
||
97 | */ |
||
98 | public function getConfig($path) |
||
106 | |||
107 | /** |
||
108 | * Returns the stored raw config array. |
||
109 | * |
||
110 | * @return array |
||
111 | */ |
||
112 | public function toArray() |
||
116 | } |
||
117 |