1 | <?php |
||
25 | abstract class AbstractEventDispatcher implements SymfonyDispatcher |
||
26 | { |
||
27 | /** |
||
28 | * The Laravel Events Dispatcher. |
||
29 | * |
||
30 | * @var \Illuminate\Contracts\Events\Dispatcher|\Illuminate\Events\Dispatcher |
||
31 | */ |
||
32 | protected $laravelDispatcher; |
||
33 | |||
34 | /** |
||
35 | * The Symfony Event Dispatcher. |
||
36 | * |
||
37 | * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface |
||
38 | */ |
||
39 | protected $symfonyDispatcher; |
||
40 | |||
41 | /** |
||
42 | * Dispatches an event to all registered listeners. |
||
43 | * |
||
44 | * @param string $eventName The name of the event to dispatch. The name of |
||
45 | * the event is the name of the method that is |
||
46 | * invoked on listeners. |
||
47 | * @param Event $event The event to pass to the event handlers/listeners. |
||
48 | * If not supplied, an empty Event instance is created. |
||
49 | * |
||
50 | * @return Event |
||
51 | */ |
||
52 | public function dispatch($eventName, Event $event = null) |
||
68 | |||
69 | /** |
||
70 | * Adds an event listener that listens on the specified events. |
||
71 | * |
||
72 | * @param string $eventName The event to listen on |
||
73 | * @param callable $listener The listener |
||
74 | * @param int $priority The higher this value, the earlier an event |
||
75 | * listener will be triggered in the chain. |
||
76 | */ |
||
77 | public function addListener($eventName, $listener, $priority = 0) |
||
81 | |||
82 | /** |
||
83 | * Adds an event subscriber. |
||
84 | * |
||
85 | * The subscriber is asked for all the events he is |
||
86 | * interested in and added as a listener for these events. |
||
87 | * |
||
88 | * @param EventSubscriberInterface $subscriber The subscriber. |
||
89 | */ |
||
90 | public function addSubscriber(EventSubscriberInterface $subscriber) |
||
94 | |||
95 | /** |
||
96 | * Removes an event listener from the specified events. |
||
97 | * |
||
98 | * @param string $eventName The event to remove a listener from |
||
99 | * @param callable $listenerToBeRemoved The listener to remove |
||
100 | */ |
||
101 | public function removeListener($eventName, $listenerToBeRemoved) |
||
105 | |||
106 | /** |
||
107 | * Removes an event subscriber. |
||
108 | * |
||
109 | * @param EventSubscriberInterface $subscriber The subscriber |
||
110 | */ |
||
111 | public function removeSubscriber(EventSubscriberInterface $subscriber) |
||
115 | |||
116 | /** |
||
117 | * Gets the listeners of a specific event or all listeners. |
||
118 | * |
||
119 | * @param string $eventName The name of the event |
||
120 | * |
||
121 | * @return array The event listeners for the specified event, or all event listeners by event name |
||
122 | */ |
||
123 | public function getListeners($eventName = null) |
||
127 | |||
128 | /** |
||
129 | * Checks whether an event has any registered listeners. |
||
130 | * |
||
131 | * @param string $eventName The name of the event |
||
132 | * |
||
133 | * @return bool true if the specified event has any listeners, false otherwise |
||
134 | */ |
||
135 | public function hasListeners($eventName = null) |
||
140 | } |
||
141 |
This method has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.