| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0175 |
| Changes | 0 | ||
| 1 | <?php |
||
| 45 | 6 | protected static function load(Iterator $configurationFiles): array |
|
| 46 | { |
||
| 47 | 6 | $loadedConfiguration = []; |
|
| 48 | |||
| 49 | 6 | foreach ($configurationFiles as $configurationFile) { |
|
| 50 | 6 | $loadedFileConfiguration = require $configurationFile; |
|
| 51 | |||
| 52 | 6 | if (!is_array($loadedFileConfiguration)) { |
|
| 53 | continue; |
||
| 54 | } |
||
| 55 | |||
| 56 | 6 | $loadedConfiguration = array_merge($loadedConfiguration, $loadedFileConfiguration); |
|
| 57 | } |
||
| 58 | |||
| 59 | 6 | return $loadedConfiguration; |
|
| 60 | } |
||
| 61 | } |
||
| 62 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.