| Conditions | 5 |
| Paths | 8 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function trigger($event) |
||
| 40 | { |
||
| 41 | $args = func_get_args(); |
||
| 42 | if (!$event instanceof Event) { |
||
| 43 | $event = $args[0] = new Event($event); |
||
| 44 | } |
||
| 45 | if (array_key_exists($event->getName(), $this->listeners)) { |
||
| 46 | foreach ($this->listeners[$event->getName()] as $listener) { |
||
| 47 | call_user_func_array($listener, $args); |
||
| 48 | if ($event->isPropagationStopped()) { |
||
| 49 | break; |
||
| 50 | } |
||
| 51 | } |
||
| 52 | } |
||
| 53 | return $this; |
||
| 54 | } |
||
| 55 | |||
| 75 |