1 | <?php |
||
17 | * } |
||
18 | */ |
||
19 | abstract class EventBus |
||
20 | { |
||
21 | /** @var EventListener[][] */ |
||
22 | protected $listeners = []; |
||
23 | |||
24 | /** |
||
25 | * @throws EventBusException |
||
26 | */ |
||
27 | 2 | public function send(Event $event): void |
|
28 | { |
||
29 | 2 | if (!isset($this->listeners[get_class($event)])) { |
|
30 | 1 | throw EventBusException::report( |
|
31 | 1 | ExceptionType::DOMAIN(), |
|
43 |