rectorphp / type-perfect

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

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

Closed janedbal closed 2 months ago

janedbal commented 2 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';
}