1 | <?php |
||
17 | abstract class ArrayLoader extends Loader |
||
18 | { |
||
19 | /** |
||
20 | * @var string|null the key in a dot notation format to insert into the config. |
||
21 | */ |
||
22 | public $key; |
||
23 | |||
24 | /** |
||
25 | * @inheritDoc |
||
26 | */ |
||
27 | 19 | public function compile() |
|
28 | { |
||
29 | 19 | $this->loadFiles(); |
|
30 | 19 | } |
|
31 | |||
32 | /** |
||
33 | * @inheritDoc |
||
34 | */ |
||
35 | 33 | public function load() |
|
36 | { |
||
37 | 33 | $this->loadFiles(); |
|
38 | 31 | } |
|
39 | |||
40 | /** |
||
41 | * Returns the config for the resolved file. |
||
42 | * @param string $path the file path. |
||
43 | * @return array the config. |
||
44 | */ |
||
45 | abstract protected function loadFile($path); |
||
46 | |||
47 | /** |
||
48 | * Returns an array with the value set in the key specified in a dot notation format. |
||
49 | * @param string $key the key name in a dot notation format. |
||
50 | * @param mixed $value the value. |
||
51 | * @return array a result array. |
||
52 | */ |
||
53 | 12 | protected function createArrayByKey($key, $value) |
|
66 | |||
67 | /** |
||
68 | * Loads resolved files into the internal config object. |
||
69 | */ |
||
70 | 49 | private function loadFiles() |
|
80 | } |
||
81 |