| Conditions | 5 |
| Paths | 7 |
| Total Lines | 19 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | 2 | public function load(array $locations, array $sources): array |
|
| 25 | { |
||
| 26 | 2 | $loadedConfigs = []; |
|
| 27 | 2 | foreach ($locations as $location) { |
|
| 28 | 2 | if (substr($location, -1) !== '/') { |
|
| 29 | 2 | $location .= '/'; |
|
| 30 | } |
||
| 31 | 2 | foreach ($sources as $source) { |
|
| 32 | 2 | $filepath = $location.$source; |
|
| 33 | 2 | if (is_readable($filepath)) { |
|
| 34 | 2 | $loadedConfigs = array_replace_recursive( |
|
| 35 | 2 | $loadedConfigs, |
|
| 36 | 2 | $this->yamlParser->parse(file_get_contents($filepath)) |
|
| 37 | ); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | } |
||
| 41 | 2 | return $loadedConfigs; |
|
| 42 | } |
||
| 43 | } |
||
| 44 |