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

Invalid "Dead catch" for constructror of \DateInterval's subclass #6262

Closed
sad-spirit opened this issue Dec 31, 2021 · 2 comments
Closed

Invalid "Dead catch" for constructror of \DateInterval's subclass #6262

sad-spirit opened this issue Dec 31, 2021 · 2 comments

Comments

@sad-spirit
Copy link

Bug report

phpstan complains about try / catch block around creation of \DateInterval's subclass.

Code snippet that reproduces the problem

https://phpstan.org/r/f274678c-13d2-4296-9e49-450e0cb6fc10

Expected output

There should be no errors as the constructor is not overridden and can still throw Exceptions.

If an instance of base \DateInterval is created, then phpstan correctly understands that an exception may be thrown in constructor.

@ondrejmirtes
Copy link
Member

This got recently fixed and works in PHPStan 1.4.4.

@github-actions
Copy link

github-actions bot commented Mar 5, 2022

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 Mar 5, 2022
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