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

False positives with *Error types #52

Closed
VasekPurchart opened this issue Aug 9, 2016 · 3 comments
Closed

False positives with *Error types #52

VasekPurchart opened this issue Aug 9, 2016 · 3 comments

Comments

@VasekPurchart
Copy link
Contributor

Newly introduced checking of *Error types in 1.1 has false positives, when a class is named *Error, but is not part of PHP's internal errors.

What's worse is that even PHP has class(es?) which are named like this, but are not an "exception".
In our code base I ran into:

$xml = @simplexml_load_string($result);
if (!($xml instanceof SimpleXMLElement) || libxml_get_last_error() instanceof LibXMLError) {
    // ...
}

which then reports error on LibXMLError, which is just a "normal" class.

This could have probably occurred with *Exception as well, although it is probably less likely.

I think, there should be a configurable list of types which are not "exceptions" - similar to the configurations of special exception names, which provide inverse functionality.

@ondrejmirtes
Copy link
Contributor

Should be fixed with #57, please test it.

@VasekPurchart
Copy link
Contributor Author

Now it works correctly, all gren, thanks :)

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants