Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EventDispatcher] Improve method resolving when it is omitted in tag #50783

Open
wants to merge 1 commit into
base: 7.1
Choose a base branch
from

Conversation

nikophil
Copy link
Contributor

@nikophil nikophil commented Jun 26, 2023

Q A
Branch? 6.4
Bug fix? no
New feature? yes
Deprecations? no
License MIT
Doc PR will be done if bugfix gets accepted

(this PR is a split of #50775)

this PR proposes to improve the listener's method resolution by:

  1. checking if a method with the "camelized" name exist.
  2. If it does not, we evaluate if one unique public method exists which would take the event as unique parameter (ie: the listener definition above would resolve someMethod() as the listener's method).
  3. if an __invoke method exist we'll use this one without checking its parameters (this is also useful for BC)
  4. Otherwise, method name needs to be provided and an exception is thrown

ping @GromNaN

(CI failures seems unrelated to this PR 馃 )

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

Successfully merging this pull request may close these issues.

None yet

3 participants