The expression return $this->getFactory...er()->get($serviceName) could return the type null which is incompatible with the type-hinted return Xervice\Kernel\Business\Service\ServiceInterface. Consider adding an additional type-check to rule them out.