| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 50 | private function detectConfigPath(array $configPathsToCheck) : string |
||
| 51 | { |
||
| 52 | foreach ($configPathsToCheck as $configPathToCheck) { |
||
| 53 | $configPath = Helpers::expand($configPathToCheck, $this->getContainerBuilder()->parameters); |
||
| 54 | if (file_exists($configPath)) { |
||
| 55 | return $configPath; |
||
| 56 | } |
||
| 57 | } |
||
| 58 | |||
| 59 | return ''; |
||
| 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.