1 | <?php |
||
19 | class Env |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * @var array Matches for particula values |
||
24 | */ |
||
25 | private static $valuesMatches = [ |
||
26 | 'true' => true, |
||
27 | '(true)' => true, |
||
28 | 'false' => false, |
||
29 | '(false)' => false, |
||
30 | 'empty' => '', |
||
31 | '(empty)' => '', |
||
32 | 'null' => null, |
||
33 | '(null)' => null, |
||
34 | ]; |
||
35 | |||
36 | /** |
||
37 | * Return the default value of the given value. |
||
38 | * |
||
39 | * @param mixed $value |
||
40 | * |
||
41 | * @return mixed |
||
42 | */ |
||
43 | 1 | private static function value($value) |
|
47 | |||
48 | /** |
||
49 | * Gets the value of an environment variable. |
||
50 | * |
||
51 | * @param string $key |
||
52 | * @param mixed $default |
||
53 | * |
||
54 | * return mixed |
||
55 | */ |
||
56 | 14 | public static function get(string $key, $default = null) |
|
72 | } |
||
73 |