public function addParam($name, $value, $convertToArrayIfExists = false)
    {
        if (isset($this->components[self::QUERY][$name])) {
            if (!is_array($this->components[self::QUERY][$name])) {
                if ($convertToArrayIfExists) {
                    $this->components[self::QUERY][$name] = [$this->components[self::QUERY][$name]];
                } else {
                    throw new \InvalidArgumentException("$name is not an array");
                }
            }
        } else {
            $this->components[self::QUERY][$name] = [];
        }
        $this->components[self::QUERY][$name][] = $value;
        return $this;
    }