protected function validateRequestLine($line)
    {
        $matches = [0 => null, 1 => null];

        if (!preg_match(self::REQUEST_LINE_REGEX, $line, $matches) || !$matches[1]) {
            throw new BadRequestException('Invalid request line', 400);
        }

        return $matches[1];
    }
protected function validateRequestLine($line)
    {
        $matches = [0 => null, 1 => null];

        if (!preg_match(self::REQUEST_LINE_REGEX, $line, $matches) || !$matches[1]) {
            throw new BadRequestException('Invalid request line', 400);
        }

        return $matches[1];
    }
protected function validateRequestLine ( $ line ) { $ matches = [ 0 => null , 1 => null ] ; if ( ! preg_match ( self :: REQUEST_LINE_REGEX , $ line , $ matches ) || ! $ matches [ 1 ] ) { throw new BadRequestException ( 'Invalid request line' , 400 ) ; } return $ matches [ 1 ] ; }
Validates a request line

@param string $line
@throws BadRequestException
Validates a request line