| @@ 230-241 (lines=12) @@ | ||
| 227 | * @param string $which |
|
| 228 | * @param \PhpParser\Node $node |
|
| 229 | */ |
|
| 230 | protected function call_misc_listener($which, \PhpParser\Node $node) { |
|
| 231 | $listeners = &$this->$which; |
|
| 232 | foreach ($listeners[0] as $listener) { |
|
| 233 | $listener($this->insert, $this, $node); |
|
| 234 | } |
|
| 235 | $cls = get_class($node); |
|
| 236 | if (array_key_exists($cls, $listeners)) { |
|
| 237 | foreach ($listeners[$cls] as $listener) { |
|
| 238 | $listener($this->insert, $this, $node); |
|
| 239 | } |
|
| 240 | } |
|
| 241 | } |
|
| 242 | ||
| 243 | /** |
|
| 244 | * @param string $which |
|
| @@ 249-259 (lines=11) @@ | ||
| 246 | * @param int $type |
|
| 247 | * @param \PhpParser\Node|null $node |
|
| 248 | */ |
|
| 249 | protected function call_entity_listener($which, $type, $id, \PhpParser\Node $node = null) { |
|
| 250 | $listeners = &$this->$which; |
|
| 251 | foreach ($listeners[0] as $listener) { |
|
| 252 | $listener($this->insert, $this, $type, $id, $node); |
|
| 253 | } |
|
| 254 | if (array_key_exists($type, $listeners)) { |
|
| 255 | foreach ($listeners[$type] as $listener) { |
|
| 256 | $listener($this->insert, $this, $type, $id, $node); |
|
| 257 | } |
|
| 258 | } |
|
| 259 | } |
|
| 260 | ||
| 261 | // from Location |
|
| 262 | ||