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

Caught class ParseError is not an exception #3690

Closed
b1rdex opened this issue Jul 31, 2020 · 4 comments
Closed

Caught class ParseError is not an exception #3690

b1rdex opened this issue Jul 31, 2020 · 4 comments

Comments

@b1rdex
Copy link
Contributor

b1rdex commented Jul 31, 2020

https://phpstan.org/r/fdea8bde-f77f-4362-b49c-9055a2de728f

I'm not sure why but PhpStan reports catching ParseError on php < 7.3

@JanTvrdik
Copy link
Contributor

Maybe related

ParseError extends CompileError as of PHP 7.3.0. Formerly, it extended Error.

@ondrejmirtes
Copy link
Member

Yes, this is because ParseError stub looks like this:

class ParseError extends CompileError {

}

Because CompileError isn't available in PHP < 7.3, to prevent errors this code in PhpStormStubsSourceStubber modifies the stub to this:

class ParseError {

}

Of course it should change the extends to Error and not just remove it. I'll fix it.

@ondrejmirtes
Copy link
Member

@github-actions
Copy link

This thread 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 14, 2021
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

3 participants