| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | protected static function guessEnvPath(): string|null |
||
| 31 | { |
||
| 32 | $defaultEnvPaths = [ |
||
| 33 | getcwd() . '/.env', |
||
| 34 | getcwd() . '/../.env', |
||
| 35 | $_SERVER['DOCUMENT_ROOT'] . '/.env', |
||
| 36 | ]; |
||
| 37 | |||
| 38 | foreach ($defaultEnvPaths as $path) { |
||
| 39 | if (file_exists($path)) { |
||
| 40 | return $path; |
||
| 41 | } |
||
| 42 | } |
||
| 43 | |||
| 44 | return null; |
||
| 45 | } |
||
| 87 |