public static function fromRingRequest(array $request)
    {
        $options = [];
        if (isset($request['version'])) {
            $options['protocol_version'] = $request['version'];
        }

        if (!isset($request['http_method'])) {
            throw new \InvalidArgumentException('No http_method');
        }

        return new Request(
            $request['http_method'],
            Core::url($request),
            isset($request['headers']) ? $request['headers'] : [],
            isset($request['body']) ? Stream::factory($request['body']) : null,
            $options
        );
    }
public static function fromRingRequest(array $request)
    {
        $options = [];
        if (isset($request['version'])) {
            $options['protocol_version'] = $request['version'];
        }

        if (!isset($request['http_method'])) {
            throw new \InvalidArgumentException('No http_method');
        }

        return new Request(
            $request['http_method'],
            Core::url($request),
            isset($request['headers']) ? $request['headers'] : [],
            isset($request['body']) ? Stream::factory($request['body']) : null,
            $options
        );
    }
public static function fromRingRequest ( array $ request ) { $ options = [ ] ; if ( isset ( $ request [ 'version' ] ) ) { $ options [ 'protocol_version' ] = $ request [ 'version' ] ; } if ( ! isset ( $ request [ 'http_method' ] ) ) { throw new \ InvalidArgumentException ( 'No http_method' ) ; } return new Request ( $ request [ 'http_method' ] , Core :: url ( $ request ) , isset ( $ request [ 'headers' ] ) ? $ request [ 'headers' ] : [ ] , isset ( $ request [ 'body' ] ) ? Stream :: factory ( $ request [ 'body' ] ) : null , $ options ) ; }
Creates a Guzzle request object using a ring request array.

@param array $request Ring request

@return Request
@throws \InvalidArgumentException for incomplete requests.
Creates a Guzzle request object using a ring request array .