| Total Complexity | 8 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | class LoadYamlConfiguration |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * Performs a core task that needs to be performed on |
||
| 23 | * early stages of the framework. |
||
| 24 | */ |
||
| 25 | public function bootstrap(): void |
||
| 26 | { |
||
| 27 | if ($this->hasYamlConfigFile()) { |
||
| 28 | $this->mergeParsedConfiguration(); |
||
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | protected function hasYamlConfigFile(): bool |
||
| 33 | { |
||
| 34 | return file_exists(Hyde::path('hyde.yml')) |
||
| 35 | || file_exists(Hyde::path('hyde.yaml')); |
||
| 36 | } |
||
| 37 | |||
| 38 | protected function mergeParsedConfiguration(): void |
||
| 39 | { |
||
| 40 | Config::set('hyde', array_merge( |
||
| 41 | Config::getArray('hyde', []), |
||
| 42 | $this->getYaml() |
||
| 43 | )); |
||
| 44 | } |
||
| 45 | |||
| 46 | protected function getYaml(): array |
||
| 49 | } |
||
| 50 | |||
| 51 | protected function getFile(): string |
||
| 52 | { |
||
| 58 |