| Total Complexity | 4 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class EventDispatcher |
||
| 8 | { |
||
| 9 | protected $listeners = []; |
||
| 10 | |||
| 11 | public function registerListener(EventListener $listener) |
||
| 12 | { |
||
| 13 | $this->listeners[] = $listener; |
||
| 14 | } |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Dispatch an event |
||
| 18 | * |
||
| 19 | * @param string $group |
||
| 20 | * @param string $event |
||
| 21 | * @param array $arguments |
||
| 22 | */ |
||
| 23 | public function dispatchEvent(string $group, string $event, array $arguments = []) |
||
| 28 | } |
||
| 29 | } |
||
| 32 |