Skip to content

Commit 1f0f2bb

Browse files
committed
Replaced array_walk() with foreach().
1 parent 2503b72 commit 1f0f2bb

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Processor.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,18 @@ private function processParams(array $config, array $expectedParams, array $actu
9999
$actualParams = array_intersect_key($actualParams, $expectedParams);
100100
}
101101

102-
$envMap = empty($config['env-map']) ? array() : (array) $config['env-map'];
102+
$envMap = array();
103+
// Add the params coming from the environment values
104+
if (!empty($config['env-map'])) {
105+
// Hydrate env-map from dist file
106+
if ('auto' === $config['env-map']) {
107+
foreach ($expectedParams as $key => $value) {
108+
$envMap[$key] = strtoupper($key);
109+
}
110+
} else {
111+
$envMap = (array) $config['env-map'];
112+
}
113+
}
103114

104115
// Add the params coming from the environment values
105116
$actualParams = array_replace($actualParams, $this->getEnvValues($envMap));

0 commit comments

Comments
 (0)