src/AbstractTransport.php
public function withParams(array $params = [], $type = null)
    {
        $object = clone $this;
        if (!$type && isset($this->configs[$this->currentParamType])) {
            $type = $this->currentParamType;
        }

        if (! $type && (
            isset($this->configs[self::PARAM_FORM]) || isset($this->configs[self::PARAM_MULTIPART]))
        ) {
            $type = isset($object->configs[self::PARAM_FORM])
                ? self::PARAM_FORM
                : (
                isset($object->configs[self::PARAM_MULTIPART])
                    ? self::PARAM_MULTIPART
                    : $type
                );
        }

        $type = $type ?: self::PARAM_FORM;
        $object->setParamType($type);
        $object->configs[$type] = $params;
        return $object->buildConfigClient();
    }
public function withParams(array $params = [], $type = null)
    {
        $object = clone $this;
        if (!$type && isset($this->configs[$this->currentParamType])) {
            $type = $this->currentParamType;
        }

        if (! $type && (
            isset($this->configs[self::PARAM_FORM]) || isset($this->configs[self::PARAM_MULTIPART]))
        ) {
            $type = isset($object->configs[self::PARAM_FORM])
                ? self::PARAM_FORM
                : (
                isset($object->configs[self::PARAM_MULTIPART])
                    ? self::PARAM_MULTIPART
                    : $type
                );
        }

        $type = $type ?: self::PARAM_FORM;
        $object->setParamType($type);
        $object->configs[$type] = $params;
        return $object->buildConfigClient();
    }
With Params

@param array $params array parameter to set
@param string $type default use TransportInterface::PARAM_FORM
@return static
@throws InvalidArgumentException