| @@ 241-252 (lines=12) @@ | ||
| 238 | * @param string $which |
|
| 239 | * @param \PhpParser\Node $node |
|
| 240 | */ |
|
| 241 | protected function call_misc_listener($which, \PhpParser\Node $node) { |
|
| 242 | $listeners = &$this->$which; |
|
| 243 | foreach ($listeners[0] as $listener) { |
|
| 244 | $listener($this->insert, $this, $node); |
|
| 245 | } |
|
| 246 | $cls = get_class($node); |
|
| 247 | if (array_key_exists($cls, $listeners)) { |
|
| 248 | foreach ($listeners[$cls] as $listener) { |
|
| 249 | $listener($this->insert, $this, $node); |
|
| 250 | } |
|
| 251 | } |
|
| 252 | } |
|
| 253 | ||
| 254 | /** |
|
| 255 | * @param string $which |
|
| @@ 260-270 (lines=11) @@ | ||
| 257 | * @param int $type |
|
| 258 | * @param \PhpParser\Node|null $node |
|
| 259 | */ |
|
| 260 | protected function call_definition_listener($which, $type, $id, \PhpParser\Node $node = null) { |
|
| 261 | $listeners = &$this->$which; |
|
| 262 | foreach ($listeners[0] as $listener) { |
|
| 263 | $listener($this->insert, $this, $type, $id, $node); |
|
| 264 | } |
|
| 265 | if (array_key_exists($type, $listeners)) { |
|
| 266 | foreach ($listeners[$type] as $listener) { |
|
| 267 | $listener($this->insert, $this, $type, $id, $node); |
|
| 268 | } |
|
| 269 | } |
|
| 270 | } |
|
| 271 | ||
| 272 | // from Location |
|
| 273 | ||