@@ 433-442 (lines=10) @@ | ||
430 | { |
|
431 | if ($children) { |
|
432 | if (is_array($children)) { |
|
433 | foreach ($children as $key => $operand) { |
|
434 | if ($operand) { |
|
435 | $result2 = $operand->walk($visitor); |
|
436 | if ($result2 === NodeTraverser::REMOVE_NODE) { |
|
437 | unset($children[$key]); |
|
438 | } elseif ($result2 instanceof NodeInterface) { |
|
439 | $children[$key] = $result2; |
|
440 | } |
|
441 | } |
|
442 | } |
|
443 | } else { |
|
444 | $result2 = $children->walk($visitor); |
|
445 | if ($result2 === NodeTraverser::REMOVE_NODE) { |
@@ 112-121 (lines=10) @@ | ||
109 | private function walkChildren(array &$children, VisitorInterface $visitor) |
|
110 | { |
|
111 | if ($children) { |
|
112 | foreach ($children as $key => $operand) { |
|
113 | if ($operand) { |
|
114 | $result2 = $operand->walk($visitor); |
|
115 | if ($result2 === NodeTraverser::REMOVE_NODE) { |
|
116 | unset($children[$key]); |
|
117 | } elseif ($result2 instanceof NodeInterface) { |
|
118 | $children[$key] = $result2; |
|
119 | } |
|
120 | } |
|
121 | } |
|
122 | } |
|
123 | } |
|
124 | } |