Zend\Diactoros\Response\Serializer::getStatusLine PHP Method

getStatusLine() private static method

Retrieve the status line for the message.
private static getStatusLine ( Psr\Http\Message\StreamInterface $stream ) : array
$stream Psr\Http\Message\StreamInterface
return array Array with three elements: 0 => version, 1 => status, 2 => 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'] : ''];
    }