| 1: | <?php declare(strict_types=1); |
| 2: | |
| 3: | namespace Salient\Core\Facade; |
| 4: | |
| 5: | use Salient\Contract\Core\Event\EventDispatcherInterface; |
| 6: | use Salient\Contract\Core\Event\EventListenerProviderInterface; |
| 7: | use Salient\Core\Event\EventDispatcher; |
| 8: | |
| 9: | /** |
| 10: | * A facade for the global event dispatcher |
| 11: | * |
| 12: | * @method static object dispatch(object $event) Dispatch a given event to listeners registered for it (see {@see EventDispatcherInterface::dispatch()}) |
| 13: | * @method static iterable<callable(object): mixed> getListenersForEvent(object $event) Get listeners registered for a given event (see {@see EventListenerProviderInterface::getListenersForEvent()}) |
| 14: | * @method static int listen(callable(object): mixed $listener, string[]|string|null $event = null) Register a listener for a given event or list of events (see {@see EventListenerProviderInterface::listen()}) |
| 15: | * @method static void removeListener(int $id) Deregister an event listener with a given listener ID (see {@see EventListenerProviderInterface::removeListener()}) |
| 16: | * |
| 17: | * @api |
| 18: | * |
| 19: | * @extends Facade<EventDispatcherInterface> |
| 20: | * |
| 21: | * @generated |
| 22: | */ |
| 23: | final class Event extends Facade |
| 24: | { |
| 25: | /** |
| 26: | * @internal |
| 27: | */ |
| 28: | protected static function getService() |
| 29: | { |
| 30: | return [ |
| 31: | EventDispatcherInterface::class, |
| 32: | EventDispatcher::class, |
| 33: | ]; |
| 34: | } |
| 35: | } |
| 36: |