Avoid false error on is_subclass_of#4472
Avoid false error on is_subclass_of#4472VincentLanglet wants to merge 4 commits intophpstan:2.1.xfrom
Conversation
a26609c to
31a5ad8
Compare
5500473 to
8576d53
Compare
|
This pull request has been marked as ready for review. |
|
This issue was more complicated than expected... I'm not against your opinion/review @staabm :) |
5aab962 to
b37f439
Compare
|
I dunno what to do about the webmozart-assert failure because I don't report anymore Technically, because a And currently, phpstan/phpstan-webmozart-assert#194 is showing the issue |
b37f439 to
16c3b71
Compare
16c3b71 to
a376aae
Compare
|
This needs to be fixed in phpstan-webmozart-assert before we can merge this: https://github.com/phpstan/phpstan-webmozart-assert/blob/b2221d38ee5338531c0bcaa985268ae5bcef452e/src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php#L401-L419 |
It's been a long time I worked on this PR, but the implementation looks fine to me. The only issue is the fact it cannot detect Because I dunno currently a way to say it cannot be the class exactly but only a child or for the call to be remembered. And so far I thought it was better to have a missing "always true" report rather than a wrong one. |
just a guess:
or maybe
absolutely |
It's more with the type instances after how to specify better than I feel like we cannot do this without a So right now @ondrejmirtes, I feel like the best we can is
And a next step could be to introduce a |
Closes phpstan/phpstan#13713
Solves phpstan/phpstan#6305 (comment)