Skip to content

[Components][EventDispatcher] Documentation for EventDispatcher aware Events is outdated #3521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SimonSimCity opened this issue Jan 29, 2014 · 1 comment
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)
Milestone

Comments

@SimonSimCity
Copy link

As I read through a bunch of my code I saw, that the method $event->getDispatcher() in my event is deprecated as of v2.4 and will be removed in v3.0, even so it's still the only documented way in the current documentation: https://github.com/symfony/symfony-docs/blob/6f286e18acdf003e2f1ced45b202b2578a4a47a6/components/event_dispatcher/introduction.rst#eventdispatcher-aware-events-and-listeners

I browsed through the change-sets on the class and found this one: symfony/event-dispatcher@d855e87

This makes it possible to create a listener like this instead of calling the method $event->getDispatcher():

class LinkRequestListener
{
    public function onKernelRequest(GetResponseEvent $event, $name, EventDispatcherInterface $dispatcher)
    {
    }
}

Please update the documentation, because I don't feel that comfortable with English to write it in a good way :)

weaverryan added a commit that referenced this issue Feb 4, 2014
…ame and the event dispatcher are passed to even... (xabbuh)

This PR was merged into the 2.4 branch.

Discussion
----------

[Components][EventDispatcher] describe that the event name and the event dispatcher are passed to even...

...t listeners by the event dispatcher

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | 2.4+
| Fixed tickets | #3521

Commits
-------

269c166 describe that the event name and the event dispatcher are passed to event listeners by the event dispatcher
@weaverryan
Copy link
Member

Thanks for the report Simon! The docs have been fixed for this :).

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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)
Projects
None yet
Development

No branches or pull requests

2 participants