I have the following edge case:
function appendToRouter(IRouter $router)
{
if ( ! $router instanceof RouteList || $router->getModule() !== NULL) {}
}
results in Call to an undefined method Nette\Application\IRouter::getModule(). which is a false positive because it is safe to assume that $router is an instance of RouteList in the right operand of the or.
I think my issue is related to this issue (lazy eval of OR):
if (is_null($this->abc) || $abc !== $this->abc->property) {
//...
}
which results into
Cannot access property $property on null.
Negated instanceof fixed in https://github.com/phpstan/phpstan/commit/9770551cae03e54f6ae38acd1639928f4679ca29.
Fixed the is_null case in: https://github.com/phpstan/phpstan/commit/3443da1c399610c5e3a50318bb10ffad5b1fbee0
Thanks for the reports @jiripudil and @CZechBoY!
Most helpful comment
Fixed the is_null case in: https://github.com/phpstan/phpstan/commit/3443da1c399610c5e3a50318bb10ffad5b1fbee0
Thanks for the reports @jiripudil and @CZechBoY!