Bug report
I am getting a false report that I cannot call a method on an object which is nullable. However, prior to calling the method I am ensuring that the object is not null.
$hasA = $b->getA() !== null;
if($hasA) {
echo $b->getA()->getId();
}
This works:
if($b->getA() !== null) {
echo $b->getA()->getId();
}
Code snippet that reproduces the problem
https://phpstan.org/r/1f58efec-096f-45ca-a68a-4d28f221d242
Did PHPStan help you today? Did it make you happy in any way?
No response
Bug report
I am getting a false report that I cannot call a method on an object which is nullable. However, prior to calling the method I am ensuring that the object is not null.
This works:
Code snippet that reproduces the problem
https://phpstan.org/r/1f58efec-096f-45ca-a68a-4d28f221d242
Did PHPStan help you today? Did it make you happy in any way?
No response