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