private function parseStatusLine(string $statusLine)
    {
        $matches = [];
        if (preg_match("=^(HTTP/\d+\.\d+) (\d{3}) ([^\r]*)=", $statusLine, $matches) == false) {
            throw new ProtocolViolation(
                    'Received status line "' . addcslashes($statusLine, "\0..\37!\177..\377")
                    . '" does not match expected format "=^(HTTP/\d+\.\d+) (\d{3}) ([^\r]*)="'
            );
        }

        $this->statusLine   = $matches[0];
        $this->version      = HttpVersion::fromString($matches[1]);
        $this->statusCode   = (int) $matches[2];
        $this->reasonPhrase = $matches[3];
    }
private function parseStatusLine(string $statusLine)
    {
        $matches = [];
        if (preg_match("=^(HTTP/\d+\.\d+) (\d{3}) ([^\r]*)=", $statusLine, $matches) == false) {
            throw new ProtocolViolation(
                    'Received status line "' . addcslashes($statusLine, "\0..\37!\177..\377")
                    . '" does not match expected format "=^(HTTP/\d+\.\d+) (\d{3}) ([^\r]*)="'
            );
        }

        $this->statusLine   = $matches[0];
        $this->version      = HttpVersion::fromString($matches[1]);
        $this->statusCode   = (int) $matches[2];
        $this->reasonPhrase = $matches[3];
    }
private function parseStatusLine ( string $ statusLine ) { $ matches = [ ] ; if ( preg_match ( "=^(HTTP/\d+\.\d+) (\d{3}) ([^\r]*)=" , $ statusLine , $ matches ) == false ) { throw new ProtocolViolation ( 'Received status line "' . addcslashes ( $ statusLine , "\0..\37!\177..\377" ) . '" does not match expected format "=^(HTTP/\d+\.\d+) (\d{3}) ([^\r]*)="' ) ; } $ this -> statusLine = $ matches [ 0 ] ; $ this -> version = HttpVersion :: fromString ( $ matches [ 1 ] ) ; $ this -> statusCode = ( int ) $ matches [ 2 ] ; $ this -> reasonPhrase = $ matches [ 3 ] ; }
parses first line of response

@param   string  $statusLine  first line of response
@throws  ProtocolViolation  when status line can not be parsed
parses first line of response