Total Complexity | 7 |
Total Lines | 50 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
14 | class Vars |
||
15 | { |
||
16 | /** |
||
17 | * @var Dotenv |
||
18 | */ |
||
19 | private static $ins = null; |
||
20 | |||
21 | /** |
||
22 | * @return Dotenv |
||
23 | */ |
||
24 | private static function env() : Dotenv |
||
25 | { |
||
26 | return self::$ins ?? self::$ins = new Dotenv; |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * @param string ...$files |
||
31 | */ |
||
32 | public static function load(string ...$files) : void |
||
33 | { |
||
34 | self::env()->load(...$files); |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * @param string $text |
||
39 | */ |
||
40 | public static function populate(string $text) : void |
||
46 | } |
||
47 | } |
||
48 | |||
49 | /** |
||
50 | * @param string $key |
||
51 | * @param string $val |
||
52 | */ |
||
53 | public static function export(string $key, string $val) : void |
||
54 | { |
||
55 | self::populate(sprintf('%s=%s', trim($key), $val)); |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * @param string $key |
||
60 | */ |
||
61 | public static function unset(string $key) : void |
||
64 | } |
||
65 | } |
||
66 |