1 | <?php |
||
16 | class Environment implements ConfigInterface |
||
17 | { |
||
18 | /** |
||
19 | * DELIMITER |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | private const DELIMITER = '_'; |
||
24 | |||
25 | /** |
||
26 | * Store |
||
27 | * |
||
28 | * @var Config |
||
29 | */ |
||
30 | private $store; |
||
31 | |||
32 | /** |
||
33 | * Load config |
||
34 | * |
||
35 | * @param string $config |
||
36 | * @param string $env |
||
37 | * @return void |
||
|
|||
38 | */ |
||
39 | public function __construct(string $config = null, string $env = null) |
||
43 | |||
44 | |||
45 | /** |
||
46 | * Get from config |
||
47 | * |
||
48 | * @param string $name |
||
49 | * @return mixed |
||
50 | */ |
||
51 | public function __get(string $name) |
||
55 | |||
56 | |||
57 | /** |
||
58 | * Get native config format as config instance |
||
59 | * |
||
60 | * @param array $environmentVariables |
||
61 | * @return Config |
||
62 | */ |
||
63 | public function map($environmentVariables = null): Config |
||
70 | |||
71 | |||
72 | /** |
||
73 | * Transform array of environment variables into a tree |
||
74 | * |
||
75 | * @param array $environmentVars |
||
76 | * @return Config |
||
77 | */ |
||
78 | protected function variablesToTree(array $environmentVars): Config |
||
116 | } |
||
117 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.