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