src/Traits/ReflectionFunctionLikeTrait.php
public function getReturnType()
    {
        $isBuiltin  = false;
        $returnType = $this->functionLikeNode->getReturnType();
        $isNullable = $returnType instanceof NullableType;

        if ($isNullable) {
            $returnType = $returnType->type;
        }
        if ($returnType instanceof Identifier) {
            $isBuiltin = true;
            $returnType = $returnType->toString();
        } elseif (is_object($returnType)) {
            $returnType = $returnType->toString();
        } elseif (is_string($returnType)) {
            $isBuiltin = true;
        } else {
            return null;
        }

        return new ReflectionType($returnType, $isNullable, $isBuiltin);
    }
public function getReturnType()
    {
        $isBuiltin  = false;
        $returnType = $this->functionLikeNode->getReturnType();
        $isNullable = $returnType instanceof NullableType;

        if ($isNullable) {
            $returnType = $returnType->type;
        }
        if ($returnType instanceof Identifier) {
            $isBuiltin = true;
            $returnType = $returnType->toString();
        } elseif (is_object($returnType)) {
            $returnType = $returnType->toString();
        } elseif (is_string($returnType)) {
            $isBuiltin = true;
        } else {
            return null;
        }

        return new ReflectionType($returnType, $isNullable, $isBuiltin);
    }
public function getReturnType ( ) { $ isBuiltin = false ; $ returnType = $ this -> functionLikeNode -> getReturnType ( ) ; $ isNullable = $ returnType instanceof NullableType ; if ( $ isNullable ) { $ returnType = $ returnType -> type ; } if ( $ returnType instanceof Identifier ) { $ isBuiltin = true ; $ returnType = $ returnType -> toString ( ) ; } elseif ( is_object ( $ returnType ) ) { $ returnType = $ returnType -> toString ( ) ; } elseif ( is_string ( $ returnType ) ) { $ isBuiltin = true ; } else { return null ; } return new ReflectionType ( $ returnType , $ isNullable , $ isBuiltin ) ; }
Gets the specified return type of a function

@return \ReflectionType

@link http://php.net/manual/en/reflectionfunctionabstract.getreturntype.php
Gets the specified return type of a function