Skip to content

Commit 6eda3fe

Browse files
author
Ivan Gavryshko
committed
MAGETWO-35009: Add update command and delete old segment classes
- changes according to CR
1 parent 359dda5 commit 6eda3fe

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

lib/internal/Magento/Framework/App/DeploymentConfig.php

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ private function load()
139139

140140
/**
141141
* Convert associative array of arbitrary depth to a flat associative array with concatenated key path as keys
142+
* each level of array is accessible by path key
142143
*
143144
* @param array $params
144145
* @param string $path
@@ -149,20 +150,18 @@ private function flattenParams(array $params, $path = null)
149150
{
150151
$cache = [];
151152

152-
if (is_array($params)) {
153-
foreach ($params as $key => $param) {
154-
if ($path) {
155-
$newPath = $path . '/' . $key;
156-
} else {
157-
$newPath = $key;
158-
}
159-
if (isset($cache[$newPath])) {
160-
throw new \Exception("Key collision {$newPath} is already defined.");
161-
}
162-
$cache[$newPath] = $param;
163-
if (is_array($param)) {
164-
$cache = array_merge($cache, $this->flattenParams($param, $newPath));
165-
}
153+
foreach ($params as $key => $param) {
154+
if ($path) {
155+
$newPath = $path . '/' . $key;
156+
} else {
157+
$newPath = $key;
158+
}
159+
if (isset($cache[$newPath])) {
160+
throw new \Exception("Key collision {$newPath} is already defined.");
161+
}
162+
$cache[$newPath] = $param;
163+
if (is_array($param)) {
164+
$cache = array_merge($cache, $this->flattenParams($param, $newPath));
166165
}
167166
}
168167

0 commit comments

Comments
 (0)