Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Change in EventDispatcher::dispatch parameters not reflected #11628

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
finwe opened this issue May 30, 2019 · 4 comments
Closed

Change in EventDispatcher::dispatch parameters not reflected #11628

finwe opened this issue May 30, 2019 · 4 comments
Assignees
Milestone

Comments

@finwe
Copy link

finwe commented May 30, 2019

Based on symfony/symfony#28920 parameter calls should be reversed in documentation.

Furthermore, in 4.3, EventDispatcher lost its dispatch method $eventName parameter - it is commented out in the source https://github.com/symfony/symfony/blob/4.3/src/Symfony/Component/EventDispatcher/EventDispatcher.php - I guess this is a bug? Should I report an issue in the main repo?

@chalasr
Copy link
Member

chalasr commented May 30, 2019

It is not a bug but a compatibility layer required for the change you linked. The argument will be uncommented in 5.0. So no, no report needed :)

But 👍 for this issue, we need that change to be documented.

@finwe
Copy link
Author

finwe commented Jun 2, 2019

Thanks, this leads me to two more questions:

  • Isn't this a breaking change for EventDispatcher 4.3 vs 4.2, removing a parameter?
  • I've run into Argument 1 passed to "Symfony\Component\EventDispatcher\EventDispatcherInterface::dispatch()" must be an instance of Symfony\Component\EventDispatcher\Event <event class> given When I extend from Contract namespace in Symfony 4.3 as noted in deprecation comment - How is that not a bug?

@xabbuh
Copy link
Member

xabbuh commented Jun 14, 2019

@finwe Please open a new issue in the code repository if you think that you found a BC break that needs to be fixed.

@javiereguiluz
Copy link
Member

Let's close this as fixed because, at least starting from 4.4, all dispatch() examples use the new signature (eventObject, eventName). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants