Conditions | 4 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
57 | public static function getenv($key, $default = null) |
||
2 ignored issues
–
show
|
|||
58 | { |
||
59 | switch (true) { |
||
60 | case array_key_exists($key, $_ENV): |
||
61 | return $_ENV[$key]; |
||
62 | case array_key_exists($key, $_SERVER): |
||
63 | return $_SERVER[$key]; |
||
64 | default: |
||
65 | $value = getenv($key); |
||
66 | return $value === false ? $default : $value; |
||
67 | } |
||
68 | } |
||
69 | } |
||
70 |