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