Zend\Code\Generator\MethodGenerator::extractReturnTypeFromMethodReflection PHP Method

extractReturnTypeFromMethodReflection() private static method

private static extractReturnTypeFromMethodReflection ( Zend\Code\Reflection\MethodReflection $methodReflection ) : null | string
$methodReflection Zend\Code\Reflection\MethodReflection
return null | string
    private static function extractReturnTypeFromMethodReflection(MethodReflection $methodReflection)
    {
        $returnType = method_exists($methodReflection, 'getReturnType') ? $methodReflection->getReturnType() : null;
        if (!$returnType) {
            return null;
        }
        if (!method_exists($returnType, 'getName')) {
            return self::expandLiteralType((string) $returnType, $methodReflection);
        }
        return ($returnType->allowsNull() ? '?' : '') . self::expandLiteralType($returnType->getName(), $methodReflection);
    }