you could say `if (! $object instanceof...) {return;}` to keep the code simpler.