| Conditions | 2 |
| Paths | 2 |
| Total Lines | 27 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | public static function build() |
||
| 29 | { |
||
| 30 | $dotenv = new Dotenv(ROOT_PATH); |
||
| 31 | $dotenv->load(); |
||
| 32 | $dotenv->required(self::$requiredVariable); |
||
| 33 | |||
| 34 | // Locator to find files |
||
| 35 | $locator = new FileLocator([ |
||
| 36 | CONFIG_PATH, |
||
| 37 | ]); |
||
| 38 | |||
| 39 | // Load config file into an array |
||
| 40 | $loader = new PHPConfigLoader($locator); |
||
| 41 | |||
| 42 | // Import all config sections |
||
| 43 | $settings = $loader->importAll(); |
||
| 44 | |||
| 45 | // Adjust error reporting |
||
| 46 | if (stripos($settings['params']['env'], 'dev') !== false) { |
||
| 47 | $settings['displayErrorDetails'] = true; |
||
| 48 | error_reporting(E_ALL); |
||
| 49 | } |
||
| 50 | |||
| 51 | return [ |
||
| 52 | 'settings' => $settings, |
||
| 53 | ]; |
||
| 54 | } |
||
| 55 | } |
||
| 56 |
This check looks for the generic type
arrayas a return type and suggests a more specific type. This type is inferred from the actual code.