src/Response/Serializer.php
private static function getStatusLine(StreamInterface $stream)
    {
        $line = self::getLine($stream);

        if (! preg_match(
            '#^HTTP/(?P<version>[1-9]\d*\.\d) (?P<status>[1-5]\d{2})(\s+(?P<reason>.+))?$#',
            $line,
            $matches
        )) {
            throw new UnexpectedValueException('No status line detected');
        }

        return [$matches['version'], $matches['status'], isset($matches['reason']) ? $matches['reason'] : ''];
    }
private static function getStatusLine(StreamInterface $stream)
    {
        $line = self::getLine($stream);

        if (! preg_match(
            '#^HTTP/(?P<version>[1-9]\d*\.\d) (?P<status>[1-5]\d{2})(\s+(?P<reason>.+))?$#',
            $line,
            $matches
        )) {
            throw new UnexpectedValueException('No status line detected');
        }

        return [$matches['version'], $matches['status'], isset($matches['reason']) ? $matches['reason'] : ''];
    }
private static function getStatusLine ( StreamInterface $ stream ) { $ line = self :: getLine ( $ stream ) ; if ( ! preg_match ( '#^HTTP/(?P<version>[1-9]\d*\.\d) (?P<status>[1-5]\d{2})(\s+(?P<reason>.+))?$#' , $ line , $ matches ) ) { throw new UnexpectedValueException ( 'No status line detected' ) ; } return [ $ matches [ 'version' ] , $ matches [ 'status' ] , isset ( $ matches [ 'reason' ] ) ? $ matches [ 'reason' ] : '' ] ; }
Retrieve the status line for the message.

@param StreamInterface $stream
@return array Array with three elements: 0 => version, 1 => status, 2 => reason
@throws UnexpectedValueException if line is malformed
Retrieve the status line for the message .