[EventDispatcher] Subscribers vs Listeners #3987
Labels
actionable
Clear and specific issues ready for anyone to take them.
EventDispatcher
good first issue
Ideal for your first contribution! (some Symfony experience may be required)
Might be worth adding one note why should one choose event listener over subscriber and vice versa. As far as I know they act essentially the same if configured properly. For example an event subscriber is aware of subscribed events by implementing
EventSubscriberInterface::getSubscribedEvents()
. But event listeners can also listen on several events simply by adding more tags:Also it might be a good idea to uniquely distinguish them all with
Listener
suffix (talking about class name). People seem to be confused what listener is and what is subscriber and they usually do things likeProfilerListener
but alsoRequestSubscriber
in their own code. And they say that is in official documentation which is true (look forStoreSubscriber
) :)Thanks!
The text was updated successfully, but these errors were encountered: