Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[EventDispatcher] Improve method resolving when it is omitted in tag#50783
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:7.4
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM, Here are minor comments. Please rebase while addressing them.
src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
f2bcee9
tod2ebe37
Compared2ebe37
todcefe70
Compareforeach ($publicMethods as $publicMethod) { | ||
if ( | ||
!$publicMethod->isStatic() | ||
&& 1 === $publicMethod->getNumberOfRequiredParameters() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This check is bad given that the EventDispatcher component actually provides 3 parameters to listeners:
- the event object
- the event name
- the EventDispatcher instance
@nikophil any chance you handle the remaining comments? |
Uh oh!
There was an error while loading.Please reload this page.
(this PR is a split of#50775)
this PR proposes to improve the listener's method resolution by:
someMethod()
as the listener's method).__invoke
method exist we'll use this one without checking its parameters (this is also useful for BC)ping@GromNaN
(CI failures seems unrelated to this PR 🤔 )