-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[EventDispatcher] Fix TraceableEventDispatcher FC/BC layer #31254
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
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.
Yes, this solves my issue, thanks!
0bef732
to
1add058
Compare
adef564
to
fd24888
Compare
See alternative in #31258 |
fd24888
to
6a78e46
Compare
@@ -296,7 +298,7 @@ private function optimizeListeners(string $eventName): array | |||
($closure = \Closure::fromCallable($listener))(...$args); | |||
}; | |||
} else { | |||
$closure = $listener instanceof \Closure ? $listener : \Closure::fromCallable($listener); | |||
$closure = $listener instanceof \Closure || $listener instanceof WrappedListener ? $listener : \Closure::fromCallable($listener); |
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.
WrappedListener handles this optimization internally
Remaining issue fixed, ready. |
a14a4ed
to
c34910e
Compare
What about also adding an assertion to the test which checks that the event instance passed to the listener actually is an instance of the |
implementing this interface is not a requirement |
c34910e
to
c5b3b34
Compare
Assertion added to ensure that the event passed to the listener is the same as the dispatched one (and not a proxy), also rebased to make the CI green. |
Thank you @chalasr. |
… (chalasr) This PR was merged into the 4.3-dev branch. Discussion ---------- [EventDispatcher] Fix TraceableEventDispatcher FC/BC layer | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | n/a | Tests pass? | yes | Fixed tickets | #31221 | License | MIT | Doc PR | n/a also renames `WrappedEvent` to `LegacyEventProxy` Commits ------- c5b3b34 [EventDispatcher] Fix TraceableEventDispatcher FC/BC layer
also renames
WrappedEvent
toLegacyEventProxy