Conditions | 7 |
Paths | 2 |
Total Lines | 22 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 56 |
Changes | 3 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | protected function pushEnvVars($vars): array |
||
26 | { |
||
27 | $env = $this->builder->getConfig('dotenv')->getValues(); |
||
28 | if (!empty($vars)) { |
||
29 | foreach ($vars as $key => &$value) { |
||
30 | if (is_array($value)) { |
||
31 | foreach (array_keys($value) as $subkey) { |
||
32 | $envKey = $this->getEnvKey($key . '_' . $subkey); |
||
33 | if (isset($env[$envKey])) { |
||
34 | $value[$subkey] = $env[$envKey]; |
||
35 | } |
||
36 | } |
||
37 | } else { |
||
38 | $envKey = $this->getEnvKey($key); |
||
39 | if (isset($env[$envKey])) { |
||
40 | $vars[$key] = $env[$envKey]; |
||
41 | } |
||
42 | } |
||
43 | } |
||
44 | } |
||
45 | |||
46 | return $vars; |
||
47 | } |
||
54 |