| Conditions | 6 |
| Paths | 7 |
| Total Lines | 22 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 42 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 27 | public function load(array $locations, array $sources): array |
||
| 28 | { |
||
| 29 | $router = $this->router; |
||
| 30 | //these variables are in scope for included routing files |
||
| 31 | $map = $router->getMap(); |
||
|
|
|||
| 32 | $configProvider = $this->configProvider; |
||
| 33 | |||
| 34 | $loadedConfigs = []; |
||
| 35 | foreach ($locations as $location) { |
||
| 36 | if (substr($location, -1) !== '/') { |
||
| 37 | $location .= '/'; |
||
| 38 | } |
||
| 39 | foreach ($sources as $source) { |
||
| 40 | $filepath = $location.$source; |
||
| 41 | if (is_file($filepath) && is_readable($filepath)) { |
||
| 42 | require_once $filepath; |
||
| 43 | $loadedConfigs[] = $filepath; |
||
| 44 | } |
||
| 45 | } |
||
| 46 | } |
||
| 47 | |||
| 48 | return $loadedConfigs; |
||
| 49 | } |
||
| 51 |