function EventDispatcherInterface::dispatch
Same name in this branch
- 11.1.x vendor/psr/event-dispatcher/src/EventDispatcherInterface.php \Psr\EventDispatcher\EventDispatcherInterface::dispatch()
Dispatches an event to all registered listeners.
@template T of object
Parameters
T $event The event to pass to the event handlers/listeners:
string|null $eventName The name of the event to dispatch. If not supplied,: the class of $event should be used instead.
Return value
T The passed $event MUST be returned
Overrides EventDispatcherInterface::dispatch
3 methods override EventDispatcherInterface::dispatch()
- EventDispatcher::dispatch in vendor/
symfony/ event-dispatcher/ EventDispatcher.php - Dispatches an event to all registered listeners.
- ImmutableEventDispatcher::dispatch in vendor/
symfony/ event-dispatcher/ ImmutableEventDispatcher.php - Dispatches an event to all registered listeners.
- TraceableEventDispatcher::dispatch in vendor/
symfony/ event-dispatcher/ Debug/ TraceableEventDispatcher.php - Dispatches an event to all registered listeners.
File
-
vendor/
symfony/ event-dispatcher-contracts/ EventDispatcherInterface.php, line 32
Class
- EventDispatcherInterface
- Allows providing hooks on domain-specific lifecycles by dispatching events.
Namespace
Symfony\Contracts\EventDispatcherCode
public function dispatch(object $event, ?string $eventName = null) : object;