-
-
Notifications
You must be signed in to change notification settings - Fork 947
Internal error: Failed to find parent class of constant #4288
Copy link
Copy link
Closed
Labels
Milestone
Description
Bug report
Phpstan fails to find class constants when used as default argument value in a trait method. I have backtracked various phpstan versions. This has not been an issue up until phpstan 0.12.25, from 0.12.26 onwards it breaks on all versions i checked including the latest 0.12.58.
Code snippet that reproduces the problem
Things I have tried to make it pass:
- constant visibility does not matter
- method visibility does not matter
- declaring class as
finalor not does not matter - the class extending a parent class does not matter
- not declaring strict types does not matter
- accessing the same constant from inside the method's body instead of the argument default value works fine: https://phpstan.org/r/2dd6fcf6-b07d-4ea6-9958-97c7393d24f0
Expected output
No errors.
Reactions are currently unavailable