src/Transport/Parser.php
private function extractFrameMeta($source)
    {
        $headers = preg_split("/(\r?\n)+/", $source);

        $this->command = array_shift($headers);

        foreach ($headers as $header) {
            $headerDetails = explode(':', $header, 2);
            $name = $this->decodeHeaderValue($headerDetails[0]);
            $value = isset($headerDetails[1]) ? $this->decodeHeaderValue($headerDetails[1]) : true;
            if (!isset($this->headers[$name])) {
                $this->headers[$name] = $value;
            }
        }

        if (isset($this->headers['content-length'])) {
            $this->expectedBodyLength = (int)$this->headers['content-length'];
        }
    }
private function extractFrameMeta($source)
    {
        $headers = preg_split("/(\r?\n)+/", $source);

        $this->command = array_shift($headers);

        foreach ($headers as $header) {
            $headerDetails = explode(':', $header, 2);
            $name = $this->decodeHeaderValue($headerDetails[0]);
            $value = isset($headerDetails[1]) ? $this->decodeHeaderValue($headerDetails[1]) : true;
            if (!isset($this->headers[$name])) {
                $this->headers[$name] = $value;
            }
        }

        if (isset($this->headers['content-length'])) {
            $this->expectedBodyLength = (int)$this->headers['content-length'];
        }
    }
private function extractFrameMeta ( $ source ) { $ headers = preg_split ( "/(\r?\n)+/" , $ source ) ; $ this -> command = array_shift ( $ headers ) ; foreach ( $ headers as $ header ) { $ headerDetails = explode ( ':' , $ header , 2 ) ; $ name = $ this -> decodeHeaderValue ( $ headerDetails [ 0 ] ) ; $ value = isset ( $ headerDetails [ 1 ] ) ? $ this -> decodeHeaderValue ( $ headerDetails [ 1 ] ) : true ; if ( ! isset ( $ this -> headers [ $ name ] ) ) { $ this -> headers [ $ name ] = $ value ; } } if ( isset ( $ this -> headers [ 'content-length' ] ) ) { $ this -> expectedBodyLength = ( int ) $ this -> headers [ 'content-length' ] ; } }
Extracts command and headers from given header source.

@param string $source
@return void
Extracts command and headers from given header source .