| 1 | <?php |
||
| 24 | trait EventCapableTrait |
||
| 25 | { |
||
| 26 | /** |
||
| 27 | * @var EventDispatcherInterface |
||
| 28 | */ |
||
| 29 | protected $dispatcher; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * set the dispatcher |
||
| 33 | * |
||
| 34 | * @param EventDispatcherInterface $dispatcher |
||
| 35 | * @return void |
||
| 36 | */ |
||
| 37 | public function setDispatcher(EventDispatcherInterface $dispatcher): void |
||
| 41 | |||
| 42 | /** |
||
| 43 | * Using the dispatcher to trigger an event. returns the event object |
||
| 44 | * |
||
| 45 | * @param object $event |
||
| 46 | * @return object |
||
| 47 | */ |
||
| 48 | protected function triggerEvent(object $event): object |
||
| 52 | } |