private function extractFromReflectionType(\ReflectionType $reflectionType)
    {
        $phpTypeOrClass = (string) $reflectionType;
        $nullable = $reflectionType->allowsNull();

        if ($reflectionType->isBuiltin()) {
            if (Type::BUILTIN_TYPE_ARRAY === $phpTypeOrClass) {
                $type = new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true);
            } else {
                $type = new Type($phpTypeOrClass, $nullable);
            }
        } else {
            $type = new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, $phpTypeOrClass);
        }

        return $type;
    }
private function extractFromReflectionType(\ReflectionType $reflectionType)
    {
        $phpTypeOrClass = (string) $reflectionType;
        $nullable = $reflectionType->allowsNull();

        if ($reflectionType->isBuiltin()) {
            if (Type::BUILTIN_TYPE_ARRAY === $phpTypeOrClass) {
                $type = new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true);
            } else {
                $type = new Type($phpTypeOrClass, $nullable);
            }
        } else {
            $type = new Type(Type::BUILTIN_TYPE_OBJECT, $nullable, $phpTypeOrClass);
        }

        return $type;
    }
private function extractFromReflectionType ( \ ReflectionType $ reflectionType ) { $ phpTypeOrClass = ( string ) $ reflectionType ; $ nullable = $ reflectionType -> allowsNull ( ) ; if ( $ reflectionType -> isBuiltin ( ) ) { if ( Type :: BUILTIN_TYPE_ARRAY === $ phpTypeOrClass ) { $ type = new Type ( Type :: BUILTIN_TYPE_ARRAY , $ nullable , null , true ) ; } else { $ type = new Type ( $ phpTypeOrClass , $ nullable ) ; } } else { $ type = new Type ( Type :: BUILTIN_TYPE_OBJECT , $ nullable , $ phpTypeOrClass ) ; } return $ type ; }
Extracts data from the PHP 7 reflection type.

@param \ReflectionType $reflectionType

@return Type
Extracts data from the PHP 7 reflection type .