1 | <?php |
||
15 | class EventDispatcherBridge implements SymfonyDispatcher |
||
16 | { |
||
17 | /** |
||
18 | * The Laravel Events Dispatcher |
||
19 | * @var \Illuminate\Contracts\Events\Dispatcher or \Illuminate\Events\Dispatcher |
||
20 | */ |
||
21 | protected $laravelDispatcher; |
||
22 | |||
23 | /** |
||
24 | * The Symfony Event Dispatcher |
||
25 | * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface |
||
26 | */ |
||
27 | protected $symfonyDispatcher; |
||
28 | |||
29 | /** |
||
30 | * Forward all methods to the Laravel Events Dispatcher |
||
31 | * @param LaravelDispatcher $laravelDispatcher |
||
32 | * @param SymfonyDispatcher $symfonyDispatcher |
||
33 | */ |
||
34 | public function __construct(LaravelDispatcher $laravelDispatcher, SymfonyDispatcher $symfonyDispatcher) |
||
39 | |||
40 | public function addListener(string $eventName, $listener, int $priority = 0) |
||
44 | |||
45 | public function addSubscriber(EventSubscriberInterface $subscriber) |
||
49 | |||
50 | public function removeListener(string $eventName, $listener) |
||
54 | |||
55 | public function removeSubscriber(EventSubscriberInterface $subscriber) |
||
59 | |||
60 | public function getListeners(string $eventName = null) |
||
64 | |||
65 | public function dispatch(object $event, string $eventName = null): object |
||
70 | |||
71 | public function getListenerPriority(string $eventName, $listener) |
||
75 | |||
76 | public function hasListeners(string $eventName = null) |
||
81 | } |
||
82 |