| Conditions | 4 |
| Paths | 4 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 75 | public static function getenv($key, $default = null) |
||
|
2 ignored issues
–
show
|
|||
| 76 | { |
||
| 77 | switch (true) { |
||
| 78 | case array_key_exists($key, $_ENV): |
||
| 79 | return $_ENV[$key]; |
||
| 80 | case array_key_exists($key, $_SERVER): |
||
| 81 | return $_SERVER[$key]; |
||
| 82 | default: |
||
| 83 | $value = getenv($key); |
||
| 84 | return $value === false ? $default : $value; |
||
| 85 | } |
||
| 86 | } |
||
| 87 | } |
||
| 88 |