Conditions | 2 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 2.0438 |
Changes | 0 |
1 | <?php |
||
18 | 6 | public static function init() |
|
19 | { |
||
20 | 6 | self::$env = new Dotenv(File::path()); |
|
21 | |||
22 | try { |
||
23 | 6 | self::$env->load(); |
|
24 | } catch (InvalidPathException $e) { |
||
25 | throw InvalidConfiguration::dotEnvNotFound(File::path()); |
||
26 | } |
||
27 | |||
28 | 6 | $configurationFiles = Finder::create()->files()->in(File::path('config'))->name('*.php')->getIterator(); |
|
29 | |||
30 | 6 | $loadedConfiguration = self::load($configurationFiles); |
|
|
|||
31 | |||
32 | 6 | self::$loadedConfigfiguration = Arr::dot($loadedConfiguration); |
|
33 | 6 | } |
|
34 | |||
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.