Commaaa2
This commit is contained in:
@@ -27,6 +27,8 @@ interface EventDispatcherInterface extends ContractsEventDispatcherInterface
|
||||
*
|
||||
* @param int $priority The higher this value, the earlier an event
|
||||
* listener will be triggered in the chain (defaults to 0)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addListener(string $eventName, callable $listener, int $priority = 0);
|
||||
|
||||
@@ -35,14 +37,21 @@ interface EventDispatcherInterface extends ContractsEventDispatcherInterface
|
||||
*
|
||||
* The subscriber is asked for all the events it is
|
||||
* interested in and added as a listener for these events.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function addSubscriber(EventSubscriberInterface $subscriber);
|
||||
|
||||
/**
|
||||
* Removes an event listener from the specified events.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function removeListener(string $eventName, callable $listener);
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function removeSubscriber(EventSubscriberInterface $subscriber);
|
||||
|
||||
/**
|
||||
@@ -50,7 +59,7 @@ interface EventDispatcherInterface extends ContractsEventDispatcherInterface
|
||||
*
|
||||
* @return array<callable[]|callable>
|
||||
*/
|
||||
public function getListeners(string $eventName = null): array;
|
||||
public function getListeners(?string $eventName = null): array;
|
||||
|
||||
/**
|
||||
* Gets the listener priority for a specific event.
|
||||
@@ -62,5 +71,5 @@ interface EventDispatcherInterface extends ContractsEventDispatcherInterface
|
||||
/**
|
||||
* Checks whether an event has any registered listeners.
|
||||
*/
|
||||
public function hasListeners(string $eventName = null): bool;
|
||||
public function hasListeners(?string $eventName = null): bool;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user