Skip to content

[CssSelector] don't raise warnings when exception is thrown #12187

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
Oct 9, 2014

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Oct 9, 2014

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #11947
License MIT
Doc PR

array_map() raises a warning when an exception is thrown inside the
callback (see https://bugs.php.net/bug.php?id=55416). To avoid these
warnings, selectorToXPath() is applied inside the loop.

`array_map()` raises a warning when an exception is thrown inside the
callback (see https://bugs.php.net/bug.php?id=55416). To avoid these
warnings, `selectorToXPath()` is applied inside the loop.
@xabbuh
Copy link
Member Author

xabbuh commented Oct 9, 2014

I wasn't able to create a proper test for this. Setting an error handler with set_error_handler() to catch the warning doesn't work. I suppose this is due to the exception that was thrown.

@stof
Copy link
Member

stof commented Oct 9, 2014

@xabbuh yeah, this is what I found when trying to debug it as well. Registering an error handler meant to catch this warning makes it disappear because of the exception, while it is still written in the logs otherwise.

@stof
Copy link
Member

stof commented Oct 9, 2014

👍

@xabbuh
Copy link
Member Author

xabbuh commented Oct 9, 2014

@stof Yeah, I'm not happy with that since we can't ensure to not have any future regressions. But I don't see how to overcome this. :(

@fabpot
Copy link
Member

fabpot commented Oct 9, 2014

Thank you @xabbuh.

@fabpot fabpot merged commit 38e9623 into symfony:2.3 Oct 9, 2014
fabpot added a commit that referenced this pull request Oct 9, 2014
…n (xabbuh)

This PR was merged into the 2.3 branch.

Discussion
----------

[CssSelector] don't raise warnings when exception is thrown

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11947
| License       | MIT
| Doc PR        |

`array_map()` raises a warning when an exception is thrown inside the
callback (see https://bugs.php.net/bug.php?id=55416). To avoid these
warnings, `selectorToXPath()` is applied inside the loop.

Commits
-------

38e9623 don't raise warnings when exception is thrown
@xabbuh xabbuh deleted the issue-11947 branch October 9, 2014 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants