1 | <?php |
||
5 | class Config |
||
6 | { |
||
7 | /** |
||
8 | * @var array |
||
9 | */ |
||
10 | protected $config = []; |
||
11 | |||
12 | /** |
||
13 | * @param array $config |
||
14 | */ |
||
15 | public function __construct(array $config = []) |
||
19 | |||
20 | /** |
||
21 | * get the config value for a given key or the entire config if key is omitted |
||
22 | * allows specifying a default that is used if key is not present in config |
||
23 | * |
||
24 | * @param string|null $key the config key |
||
25 | * @param mixed|null $default the default value |
||
26 | * @return array|mixed|null the config value or the entire configuration array |
||
27 | */ |
||
28 | public function get($key = null, $default = null) |
||
36 | |||
37 | /** |
||
38 | * @param string $path |
||
39 | * @param mixed|null $default |
||
40 | * @return array|mixed|null |
||
41 | */ |
||
42 | protected function resolve($path, $default = null) |
||
57 | |||
58 | /** |
||
59 | * @param array|null $config |
||
60 | * @return array |
||
61 | */ |
||
62 | public function flatten(array $config = null): array |
||
86 | } |