update v 1.0.7.5

This commit is contained in:
Sujit Prasad
2016-06-13 20:41:55 +05:30
parent aa9786d829
commit 283d97e3ea
5078 changed files with 339851 additions and 175995 deletions

View File

@@ -19,7 +19,7 @@ class NodeTraverser implements NodeTraverserInterface
*
* @param bool $cloneNodes Should the traverser clone the nodes when traversing the AST
*/
public function __construct($cloneNodes = true) {
public function __construct($cloneNodes = false) {
$this->visitors = array();
$this->cloneNodes = $cloneNodes;
}
@@ -99,6 +99,12 @@ class NodeTraverser implements NodeTraverserInterface
foreach ($this->visitors as $visitor) {
if (null !== $return = $visitor->leaveNode($subNode)) {
if (is_array($return)) {
throw new \LogicException(
'leaveNode() may only return an array ' .
'if the parent structure is an array'
);
}
$subNode = $return;
}
}