-
Couldn't load subscription status.
- Fork 544
Avoid false error on is_subclass_of #4472
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
Conversation
a26609c to
31a5ad8
Compare
31a5ad8 to
f2663f1
Compare
5500473 to
8576d53
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the original check
// prevent false-positives in IsAFunctionTypeSpecifyingHelper
if ($classType->getConstantStrings() === [] && $resultType->isSuperTypeOf($objectOrClassType)->yes()) {
return new SpecifiedTypes([], []);
}
This pull request has been marked as ready for review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this is too complicated to be detected since we don't make a difference in ObjectType between the exact class and one of the children.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this PR there is no error here which fix phpstan/phpstan#13713
but I dunno why the bot is not detecting the change...
This issue was more complicated than expected... I'm not against your opinion/review @staabm :)
Uh oh!
There was an error while loading. Please reload this page.
Closes phpstan/phpstan#13713
Solves phpstan/phpstan#6305 (comment)
Partially revert #1044 cc @herndlm
I don't think we can resolve the original request of phpstan/phpstan#6305 (comment) without introducing lot of false positive, like shown by this PR.