| @@ 84-101 (lines=18) @@ | ||
| 81 | * |
|
| 82 | * @param VisitorInterface $visitor |
|
| 83 | */ |
|
| 84 | public function walk(VisitorInterface $visitor) { |
|
| 85 | $node = $this; |
|
| 86 | $result = $visitor->enterNode($node); |
|
| 87 | if ($result instanceof NodeInterface) { |
|
| 88 | $node = $result; |
|
| 89 | } |
|
| 90 | if ($result !== NodeTraverser::DONT_TRAVERSE_CHILDREN) { |
|
| 91 | foreach ($this->operands as $key => $operand) { |
|
| 92 | $result2 = $operand->walk($visitor); |
|
| 93 | if ($result2 === NodeTraverser::REMOVE_NODE) { |
|
| 94 | unset($this->operands[$key]); |
|
| 95 | } elseif ($result2 instanceof NodeInterface) { |
|
| 96 | $this->operands[$key] = $result2; |
|
| 97 | } |
|
| 98 | } |
|
| 99 | } |
|
| 100 | return $visitor->leaveNode($node); |
|
| 101 | } |
|
| 102 | ||
| 103 | /** |
|
| 104 | * Returns the symbol for this operator. |
|
| @@ 161-178 (lines=18) @@ | ||
| 158 | * |
|
| 159 | * @param VisitorInterface $visitor |
|
| 160 | */ |
|
| 161 | public function walk(VisitorInterface $visitor) { |
|
| 162 | $node = $this; |
|
| 163 | $result = $visitor->enterNode($node); |
|
| 164 | if ($result instanceof NodeInterface) { |
|
| 165 | $node = $result; |
|
| 166 | } |
|
| 167 | if ($result !== NodeTraverser::DONT_TRAVERSE_CHILDREN) { |
|
| 168 | foreach ($this->subTree as $key => $operand) { |
|
| 169 | $result2 = $operand->walk($visitor); |
|
| 170 | if ($result2 === NodeTraverser::REMOVE_NODE) { |
|
| 171 | unset($this->subTree[$key]); |
|
| 172 | } elseif ($result2 instanceof NodeInterface) { |
|
| 173 | $this->subTree[$key] = $result2; |
|
| 174 | } |
|
| 175 | } |
|
| 176 | } |
|
| 177 | return $visitor->leaveNode($node); |
|
| 178 | } |
|
| 179 | } |
|
| 180 | ||
| @@ 204-221 (lines=18) @@ | ||
| 201 | * |
|
| 202 | * @param VisitorInterface $visitor |
|
| 203 | */ |
|
| 204 | public function walk(VisitorInterface $visitor) { |
|
| 205 | $node = $this; |
|
| 206 | $result = $visitor->enterNode($node); |
|
| 207 | if ($result instanceof NodeInterface) { |
|
| 208 | $node = $result; |
|
| 209 | } |
|
| 210 | if ($result !== NodeTraverser::DONT_TRAVERSE_CHILDREN) { |
|
| 211 | foreach ($this->subTree as $key => $operand) { |
|
| 212 | $result2 = $operand->walk($visitor); |
|
| 213 | if ($result2 === NodeTraverser::REMOVE_NODE) { |
|
| 214 | unset($this->subTree[$key]); |
|
| 215 | } elseif ($result2 instanceof NodeInterface) { |
|
| 216 | $this->subTree[$key] = $result2; |
|
| 217 | } |
|
| 218 | } |
|
| 219 | } |
|
| 220 | return $visitor->leaveNode($node); |
|
| 221 | } |
|
| 222 | } |
|
| 223 | ||
| @@ 195-212 (lines=18) @@ | ||
| 192 | * |
|
| 193 | * @param VisitorInterface $visitor |
|
| 194 | */ |
|
| 195 | public function walk(VisitorInterface $visitor) { |
|
| 196 | $node = $this; |
|
| 197 | $result = $visitor->enterNode($node); |
|
| 198 | if ($result instanceof NodeInterface) { |
|
| 199 | $node = $result; |
|
| 200 | } |
|
| 201 | if ($result !== NodeTraverser::DONT_TRAVERSE_CHILDREN) { |
|
| 202 | foreach ($this->subTree as $key => $operand) { |
|
| 203 | $result2 = $operand->walk($visitor); |
|
| 204 | if ($result2 === NodeTraverser::REMOVE_NODE) { |
|
| 205 | unset($this->subTree[$key]); |
|
| 206 | } elseif ($result2 instanceof NodeInterface) { |
|
| 207 | $this->subTree[$key] = $result2; |
|
| 208 | } |
|
| 209 | } |
|
| 210 | } |
|
| 211 | return $visitor->leaveNode($node); |
|
| 212 | } |
|
| 213 | } |
|
| 214 | ||
| @@ 162-179 (lines=18) @@ | ||
| 159 | * |
|
| 160 | * @param VisitorInterface $visitor |
|
| 161 | */ |
|
| 162 | public function walk(VisitorInterface $visitor) { |
|
| 163 | $node = $this; |
|
| 164 | $result = $visitor->enterNode($node); |
|
| 165 | if ($result instanceof NodeInterface) { |
|
| 166 | $node = $result; |
|
| 167 | } |
|
| 168 | if ($result !== NodeTraverser::DONT_TRAVERSE_CHILDREN) { |
|
| 169 | foreach ($this->subTree as $key => $operand) { |
|
| 170 | $result2 = $operand->walk($visitor); |
|
| 171 | if ($result2 === NodeTraverser::REMOVE_NODE) { |
|
| 172 | unset($this->subTree[$key]); |
|
| 173 | } elseif ($result2 instanceof NodeInterface) { |
|
| 174 | $this->subTree[$key] = $result2; |
|
| 175 | } |
|
| 176 | } |
|
| 177 | } |
|
| 178 | return $visitor->leaveNode($node); |
|
| 179 | } |
|
| 180 | } |
|
| 181 | ||