src/Reflection/ReflectionFunctionAbstract.php
public function getReturnType() : ?ReflectionType
    {
        $returnType = $this->node->getReturnType();

        if ($returnType === null) {
            return null;
        }

        if ($returnType instanceof NullableType) {
            return ReflectionType::createFromTypeAndReflector((string) $returnType->type, true, $this->reflector);
        }

        return ReflectionType::createFromTypeAndReflector((string) $returnType, false, $this->reflector);
    }
public function getReturnType() : ?ReflectionType
    {
        $returnType = $this->node->getReturnType();

        if ($returnType === null) {
            return null;
        }

        if ($returnType instanceof NullableType) {
            return ReflectionType::createFromTypeAndReflector((string) $returnType->type, true, $this->reflector);
        }

        return ReflectionType::createFromTypeAndReflector((string) $returnType, false, $this->reflector);
    }
Get the return type declaration (only for PHP 7+ code)