- Allow
#[AsEventListener]attribute on methods
- Add
#[AsEventListener]attribute for declaring listeners on PHP 8
- The
LegacyEventDispatcherProxyclass has been deprecated. - Added an optional
dispatcherattribute to the listener and subscriber tags inRegisterListenerPass.
- The signature of the
EventDispatcherInterface::dispatch()method has been changed todispatch($event, string $eventName = null): object. - The
Eventclass has been removed in favor ofSymfony\Contracts\EventDispatcher\Event. - The
TraceableEventDispatcherInterfacehas been removed. - The
WrappedListenerclass is now final.
AddEventAliasesPasshas been added, allowing applications and bundles to extend the event alias mapping used byRegisterListenersPass.- Made the
eventattribute of thekernel.event_listenertag optional for FQCN events.
- The signature of the
EventDispatcherInterface::dispatch()method should be updated todispatch($event, string $eventName = null), not doing so is deprecated - deprecated the
Eventclass, useSymfony\Contracts\EventDispatcher\Eventinstead
- added support for invokable event listeners tagged with
kernel.event_listenerby default - The
TraceableEventDispatcher::getOrphanedEvents()method has been added. - The
TraceableEventDispatcherInterfacehas been deprecated.
- removed the
ContainerAwareEventDispatcherclass - added the
reset()method to theTraceableEventDispatcherInterface
- Implementing
TraceableEventDispatcherInterfacewithout thereset()method has been deprecated.
- The ContainerAwareEventDispatcher class has been deprecated. Use EventDispatcher with closure factories instead.
- The method
getListenerPriority($eventName, $listener)has been added to theEventDispatcherInterface. - The methods
Event::setDispatcher(),Event::getDispatcher(),Event::setName()andEvent::getName()have been removed. The event dispatcher and the event name are passed to the listener call.
- added Debug\TraceableEventDispatcher (originally in HttpKernel)
- changed Debug\TraceableEventDispatcherInterface to extend EventDispatcherInterface
- added RegisterListenersPass (originally in HttpKernel)
- added TraceableEventDispatcherInterface
- added ContainerAwareEventDispatcher
- added a reference to the EventDispatcher on the Event
- added a reference to the Event name on the event
- added fluid interface to the dispatch() method which now returns the Event object
- added GenericEvent event class
- added the possibility for subscribers to subscribe several times for the same event
- added ImmutableEventDispatcher