-
Notifications
You must be signed in to change notification settings - Fork 462
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
Report always false usages of is_a #440
Conversation
Hi, could you achieve the same behaviour by modifying IsAFunctionTypeSpecifyingExtension instead? The |
If I understand |
@b1rdex Nope, just the logic of |
So I finally learned the thing: return $this->typeSpecifier->create(
$node,
new ConstantBooleanType(false),
$context
); sets the function return type to if (is_a(Bar::class, Foo::class)) {
dumpType(is_a(Bar::class, Foo::class));
} and it dumps if ($a = is_a(Bar::class, Foo::class)) {
dumpType($a);
} and it dumps |
efd31ce
to
0471f87
Compare
ddd20b4
to
95d480b
Compare
@ondrejmirtes I think we can close this one as well then |
just posting the anwser here, since I also worked thru this recently: the cited code is not correct. instead it works like this:
|
Implemented a different way here: #1311 |
Fixes phpstan/phpstan#4371