1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-06 03:50:04 +02:00
Daniel Neto 2024-03-05 19:22:51 -03:00
parent 7673eda07e
commit 330cdbe615
9054 changed files with 480487 additions and 41800 deletions

View file

@ -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,21 +59,17 @@ interface EventDispatcherInterface extends ContractsEventDispatcherInterface
*
* @return array<callable[]|callable>
*/
public function getListeners(string $eventName = null);
public function getListeners(?string $eventName = null): array;
/**
* Gets the listener priority for a specific event.
*
* Returns null if the event or the listener does not exist.
*
* @return int|null
*/
public function getListenerPriority(string $eventName, callable $listener);
public function getListenerPriority(string $eventName, callable $listener): ?int;
/**
* Checks whether an event has any registered listeners.
*
* @return bool
*/
public function hasListeners(string $eventName = null);
public function hasListeners(?string $eventName = null): bool;
}