Skip to content

Commit

Permalink
Merge pull request #640 from magento-sparta/2.0.7_backlog
Browse files Browse the repository at this point in the history
[Support] Magento 2.0.7 Backlog
  • Loading branch information
magicbunneh committed May 19, 2016
2 parents 17ac035 + 41f4ace commit 2736929
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion lib/internal/Magento/Framework/App/Config/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class Data implements DataInterface
*/
public function __construct(MetadataProcessor $processor, array $data)
{
$this->_data = $processor->process($data);
/** Clone the array to work around a kink in php7 that modifies the argument by reference */
$this->_data = $processor->process($this->_arrayClone($data));
$this->_source = $data;
}

Expand Down Expand Up @@ -77,4 +78,19 @@ public function setValue($path, $value)
}
$currentElement[$lastKey] = $value;
}

/**
* Copy array by value
*
* @param array $data
* @return array
*/
private function _arrayClone(array $data)
{
$clone = [];
foreach ($data as $key => $value) {
$clone[$key]= $value;
}
return $clone;
}
}

0 comments on commit 2736929

Please sign in to comment.