Skip to content

Allow WrappedListener to describe uncallable listeners #31615

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

Merged
merged 1 commit into from
May 25, 2019

Conversation

derrabus
Copy link
Member

Q A
Branch? 4.3
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #31493
License MIT
Doc PR N/A

This is a follow-up to #31493. The previous PR did not fix the problem completely. We also need to make sure that a listener that is not callable is not passed to Closure::fromCallable().

Note: It would probably be a good idea to give the developer a hint about uncallable listeners. Currently, such a listener causes an exception at the worst possible point of time: when collecting the profile information. This breaks the toolbar without any helpful feedback, as I've described here.

This PR allows the WrappedListener class to describe a listener for the profiler even if the listener is not callable, which was the behavior in Symfony 4.2.

@fabpot
Copy link
Member

fabpot commented May 25, 2019

Thank you @derrabus.

@fabpot fabpot merged commit bc3f598 into symfony:4.3 May 25, 2019
fabpot added a commit that referenced this pull request May 25, 2019
…rrabus)

This PR was merged into the 4.3 branch.

Discussion
----------

Allow WrappedListener to describe uncallable listeners

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #31493
| License       | MIT
| Doc PR        | N/A

This is a follow-up to #31493. The previous PR did not fix the problem completely. We also need to make sure that a listener that is not callable is not passed to `Closure::fromCallable()`.

Note: It would probably be a good idea to give the developer a hint about uncallable listeners. Currently, such a listener causes an exception at the worst possible point of time: when collecting the profile information. This breaks the toolbar without any helpful feedback, as I've described [here](#31493 (comment)).

This PR allows the `WrappedListener` class to describe a listener for the profiler even if the listener is not callable, which was the behavior in Symfony 4.2.

Commits
-------

bc3f598 Allow WrappedListener to describe uncallable listeners.
@derrabus derrabus deleted the bugfix/describe-uncallable-listener branch May 25, 2019 17:41
@fabpot fabpot mentioned this pull request May 28, 2019
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.

6 participants