File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed
lib/internal/Magento/Framework/App Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,7 @@ private function load()
139
139
140
140
/**
141
141
* 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
142
143
*
143
144
* @param array $params
144
145
* @param string $path
@@ -149,20 +150,18 @@ private function flattenParams(array $params, $path = null)
149
150
{
150
151
$ cache = [];
151
152
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 ));
166
165
}
167
166
}
168
167
You can’t perform that action at this time.
0 commit comments