| Conditions | 4 |
| Paths | 4 |
| Total Lines | 14 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 90 | 12 | public static function getenv($key, $default = null) |
|
| 91 | { |
||
| 92 | 8 | switch (true) { |
|
| 93 | 12 | case array_key_exists($key, $_ENV): |
|
| 94 | 3 | return $_ENV[$key]; |
|
| 95 | |||
| 96 | 9 | case array_key_exists($key, $_SERVER): |
|
| 97 | 3 | return $_SERVER[$key]; |
|
| 98 | |||
| 99 | 4 | default: |
|
| 100 | 6 | $value = getenv($key); |
|
| 101 | 6 | return $value === false ? $default : $value; |
|
| 102 | 4 | } |
|
| 103 | } |
||
| 104 | } |
||
| 105 |