1 | <?php |
||
5 | class Config implements \ArrayAccess |
||
6 | { |
||
7 | |||
8 | private $config; |
||
9 | private $context = 'default'; |
||
10 | |||
11 | /** |
||
12 | * Reads the configurations stored at a given path. |
||
13 | * |
||
14 | * Path could either point to a directory or a specific file. In the case of |
||
15 | * a file, the contents of the file are read into the config object. However, |
||
16 | * in the case of a directory, the contents of all the files in the directory |
||
17 | * are read into the config file with configurations from each file prefixed with |
||
18 | * the file name. |
||
19 | * |
||
20 | * @param string $path |
||
21 | * @return Config |
||
22 | */ |
||
23 | 4 | public function readPath($path) |
|
40 | |||
41 | public function isKeySet($key) |
||
45 | |||
46 | 6 | public function get($key, $default = null) |
|
50 | |||
51 | 1 | public function setContext($context) |
|
55 | |||
56 | |||
57 | 3 | public function set($key, $value) |
|
63 | |||
64 | 3 | private function setValue($keys, $value, $config, $nested = [], &$merge = []) |
|
81 | |||
82 | 4 | private function expand($array, $prefix = null) |
|
97 | |||
98 | public function offsetExists($offset): bool |
||
102 | |||
103 | public function offsetGet($offset) |
||
107 | |||
108 | public function offsetSet($offset, $value): void |
||
112 | |||
113 | public function offsetUnset($offset): void |
||
117 | |||
118 | } |
||
119 |