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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HttpKernel] Make ErrorListener unaware of the event dispatcher #35635

Conversation

@derrabus
Copy link
Contributor

derrabus commented Feb 7, 2020

Q A
Branch? master
Bug fix? no
New feature? no
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

Under certain circumstances, HttpKernel's ErrorListener class might dynamically register and unregister a listener with the dispatcher. If our goal is to make the dispatcher immutable, that specific behavior would be in our way. Also, #34988 would break this workflow.

This PR provides an alternative. The listener is always registered, but I'm using the request to piggyback a flag that activates/deactivates the listener.

@derrabus derrabus requested a review from nicolas-grekas Feb 7, 2020
@nicolas-grekas nicolas-grekas added this to the next milestone Feb 7, 2020
Copy link
Member

nicolas-grekas left a comment

with one minor comment

@derrabus derrabus force-pushed the derrabus:improvement/make-error-listener-unaware-of-ed branch from 8c8ae6f to a9d1ded Feb 7, 2020
@derrabus

This comment has been minimized.

Copy link
Contributor Author

derrabus commented Feb 7, 2020

Done. The Travis failure looks unrelated.

@Tobion
Tobion approved these changes Feb 8, 2020
@fabpot
fabpot approved these changes Feb 8, 2020
@fabpot

This comment has been minimized.

Copy link
Member

fabpot commented Feb 8, 2020

Thank you @derrabus.

fabpot added a commit that referenced this pull request Feb 8, 2020
…ispatcher (derrabus)

This PR was merged into the 5.1-dev branch.

Discussion
----------

[HttpKernel] Make ErrorListener unaware of the event dispatcher

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

Under certain circumstances, HttpKernel's `ErrorListener` class might dynamically register and unregister a listener with the dispatcher. If our goal is to make the dispatcher immutable, that specific behavior would be in our way. Also, #34988 would break this workflow.

This PR provides an alternative. The listener is always registered, but I'm using the request to piggyback a flag that activates/deactivates the listener.

Commits
-------

a9d1ded [HttpKernel] Make ErrorListener unaware of the event dispatcher.
@fabpot fabpot merged commit a9d1ded into symfony:master Feb 8, 2020
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.