Skip to content

[Event Dispatcher] SF 4.3, EventListener receiving WrappedEvent class instead of actual event class #31221

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
raress96 opened this issue Apr 24, 2019 · 0 comments

Comments

@raress96
Copy link

Symfony version(s) affected: 4.3.x

Description
When registering an EventListener / Subscriber in SF 4.3 dev for a custom event, the actual event that is passed to the function is of instance WrappedEvent, which seems to be an internal class.
The actual event dispatched can be gotten from the WrappedEvent class, but since it is marked as internal and will be removed in SF 5, I don't think this class should be dispatched.

How to reproduce
Create an EventListener / EventSubscriber for a custom event, dispatch it and see what happens.

nicolas-grekas added a commit that referenced this issue Apr 27, 2019
… (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
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