\Symfony\Contracts\EventDispatcherEventDispatcherInterface

Allows providing hooks on domain-specific lifecycles by dispatching events.

Summary

Methods
Constants
dispatch()
No constants found
No protected methods found
N/A
No private methods found
N/A

Methods

dispatch()

dispatch(object  $event, string|null  $eventName = null) : object

Dispatches an event to all registered listeners.

Parameters

object $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.

Returns

object —

The passed $event MUST be returned