src/Emulator/HttpEmulator.php
public function getIncomingStream()
    {
        $options = stream_context_get_options($this->context);

        $method = 'GET';
        if (isset($options['http']['method'])) {
            $method = $options['http']['method'];
        }
        $headers = [];
        if (isset($options['http']['header'])) {
            $headerLines = explode("\r\n", $options['http']['header']);
            foreach ($headerLines as $headerLine) {
                if (!$headerLine) {
                    continue;
                }

                list($header, $value) = explode(': ', $headerLine, 2);

                $headers[$header][] = $value;
            }
        }
        $body = null;
        if (isset($options['http']['content'])) {
            $body = $options['http']['content'];
        }
        $protocolVersion = 1.1;
        if (isset($options['http']['protocol_version'])) {
            $protocolVersion = $options['http']['protocol_version'];
        }

        $request = new Request($method, $this->path, $headers, $body, $protocolVersion);

        return \GuzzleHttp\Psr7\stream_for(\GuzzleHttp\Psr7\str($request));
    }
public function getIncomingStream()
    {
        $options = stream_context_get_options($this->context);

        $method = 'GET';
        if (isset($options['http']['method'])) {
            $method = $options['http']['method'];
        }
        $headers = [];
        if (isset($options['http']['header'])) {
            $headerLines = explode("\r\n", $options['http']['header']);
            foreach ($headerLines as $headerLine) {
                if (!$headerLine) {
                    continue;
                }

                list($header, $value) = explode(': ', $headerLine, 2);

                $headers[$header][] = $value;
            }
        }
        $body = null;
        if (isset($options['http']['content'])) {
            $body = $options['http']['content'];
        }
        $protocolVersion = 1.1;
        if (isset($options['http']['protocol_version'])) {
            $protocolVersion = $options['http']['protocol_version'];
        }

        $request = new Request($method, $this->path, $headers, $body, $protocolVersion);

        return \GuzzleHttp\Psr7\stream_for(\GuzzleHttp\Psr7\str($request));
    }
public function getIncomingStream ( ) { $ options = stream_context_get_options ( $ this -> context ) ; $ method = 'GET' ; if ( isset ( $ options [ 'http' ] [ 'method' ] ) ) { $ method = $ options [ 'http' ] [ 'method' ] ; } $ headers = [ ] ; if ( isset ( $ options [ 'http' ] [ 'header' ] ) ) { $ headerLines = explode ( "\r\n" , $ options [ 'http' ] [ 'header' ] ) ; foreach ( $ headerLines as $ headerLine ) { if ( ! $ headerLine ) { continue ; } list ( $ header , $ value ) = explode ( ': ' , $ headerLine , 2 ) ; $ headers [ $ header ] [ ] = $ value ; } } $ body = null ; if ( isset ( $ options [ 'http' ] [ 'content' ] ) ) { $ body = $ options [ 'http' ] [ 'content' ] ; } $ protocolVersion = 1.1 ; if ( isset ( $ options [ 'http' ] [ 'protocol_version' ] ) ) { $ protocolVersion = $ options [ 'http' ] [ 'protocol_version' ] ; } $ request = new Request ( $ method , $ this -> path , $ headers , $ body , $ protocolVersion ) ; return \ GuzzleHttp \ Psr7 \ stream_for ( \ GuzzleHttp \ Psr7 \ str ( $ request ) ) ; }
{@inheritDoc}
{