The expression return $this->getScope() could return the type Cycle\ORM\Select\ScopeInterface which includes types incompatible with the type-hinted return Cycle\ORM\Select\ConstrainInterface|null. Consider adding an additional type-check to rule them out.