File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
lib/internal/Magento/Framework/App/Config Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ class Data implements DataInterface
29
29
*/
30
30
public function __construct (MetadataProcessor $ processor , array $ data )
31
31
{
32
- $ this ->_data = $ processor ->process ($ data );
32
+ /** Clone the array to work around a kink in php7 that modifies the argument by reference */
33
+ $ this ->_data = $ processor ->process ($ this ->_arrayClone ($ data ));
33
34
$ this ->_source = $ data ;
34
35
}
35
36
@@ -77,4 +78,19 @@ public function setValue($path, $value)
77
78
}
78
79
$ currentElement [$ lastKey ] = $ value ;
79
80
}
81
+
82
+ /**
83
+ * Copy array by value
84
+ *
85
+ * @param array $data
86
+ * @return array
87
+ */
88
+ private function _arrayClone (array $ data )
89
+ {
90
+ $ clone = [];
91
+ foreach ($ data as $ key => $ value ) {
92
+ $ clone [$ key ]= $ value ;
93
+ }
94
+ return $ clone ;
95
+ }
80
96
}
You can’t perform that action at this time.
0 commit comments