rectorphp / type-perfect

Next level type declaration check PHPStan rules
https://getrector.com/blog/introducing-type-perfect-for-extra-safety
MIT License
76 stars 6 forks source link

Invalid report of `Use instanceof instead of isset() on object` #10

Closed janedbal closed 5 months ago

janedbal commented 5 months ago

It reports even those cases where you cannot use instanceof:


$condition = false;

if ($condition) {
    $object = new stdClass();
}

if (isset($object)) {
    $object->foo = 'bar';
}