-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
ShouldNotHappenException in NonObjectTypeTrait when analyzing one of the classes #42
Comments
UPDATE I traced it down to a certain use case $something::STEP_NAME |
Hi @stanislau93. Thanks for the report.
And now also tested where Where's the |
Hello @spaze, Thank you for the swift response we use this constant in a static method to create a value object public function __construct($name)
It is defined in an abstract class as a public const and later redefined in two classes that extend from it |
Update: maybe you'll reproduce it after feeding a classname to a function like this - this was actually our use case.
As I've mentioned before - there are multiple classes that redefine this constant For now we've built a workaround to avoid this issue which seems to work:
|
Thanks. I now know where the issue it but I don't know how to fix it properly. I've only made some changes so that PHPStan is not crashing. You'll see errors like Less than ideal but I think still better than crashes. I'll release the fix in a few days unless I get some better idea (don't hold your breath). |
1.2.0 which contains the crash fix has been released. |
Great, many thanks for your help! |
Hello everyone,
Just tried out your nice tool on one of our projects and in one of the files I get the following error:
Stack trace:
It breaks when analyzing a class that calls the STEP_NAME constant. The constant with this name is defined in multiple other classes.
Please let me know if you need more details.
The text was updated successfully, but these errors were encountered: