public function setParamType($type)
    {
        if (! is_string($type) || ! in_array($type, [self::PARAM_MULTIPART, self::PARAM_FORM])
        ) {
            throw new InvalidArgumentException(
                sprintf(
                    "Invalid parameter form type, form type only allowed $1s and $2s",
                    self::PARAM_FORM,
                    self::PARAM_MULTIPART
                ),
                E_USER_ERROR
            );
        }

        $this->currentParamType = $type;
        $reverse_params = $type == self::PARAM_FORM
            ? self::PARAM_MULTIPART
            : self::PARAM_FORM;
        $reverse_params_value = isset($this->configs[$reverse_params])
            ? $this->configs[$reverse_params]
            : null;
        $params_value = isset($this->configs[$type])
            ? $this->configs[$type]
            : null;
        unset(
            $this->configs[self::PARAM_FORM],
            $this->configs[self::PARAM_MULTIPART]
        );

        $this->configs[$type] = is_array($reverse_params_value)
            ? $reverse_params_value
            : (is_array($params_value) ? $params_value : []);

        return $this->buildConfigClient();
    }
public function setParamType($type)
    {
        if (! is_string($type) || ! in_array($type, [self::PARAM_MULTIPART, self::PARAM_FORM])
        ) {
            throw new InvalidArgumentException(
                sprintf(
                    "Invalid parameter form type, form type only allowed $1s and $2s",
                    self::PARAM_FORM,
                    self::PARAM_MULTIPART
                ),
                E_USER_ERROR
            );
        }

        $this->currentParamType = $type;
        $reverse_params = $type == self::PARAM_FORM
            ? self::PARAM_MULTIPART
            : self::PARAM_FORM;
        $reverse_params_value = isset($this->configs[$reverse_params])
            ? $this->configs[$reverse_params]
            : null;
        $params_value = isset($this->configs[$type])
            ? $this->configs[$type]
            : null;
        unset(
            $this->configs[self::PARAM_FORM],
            $this->configs[self::PARAM_MULTIPART]
        );

        $this->configs[$type] = is_array($reverse_params_value)
            ? $reverse_params_value
            : (is_array($params_value) ? $params_value : []);

        return $this->buildConfigClient();
    }
public function setParamType ( $ type ) { if ( ! is_string ( $ type ) || ! in_array ( $ type , [ self :: PARAM_MULTIPART , self :: PARAM_FORM ] ) ) { throw new InvalidArgumentException ( sprintf ( "Invalid parameter form type, form type only allowed $1s and $2s" , self :: PARAM_FORM , self :: PARAM_MULTIPART ) , E_USER_ERROR ) ; } $ this -> currentParamType = $ type ; $ reverse_params = $ type == self :: PARAM_FORM ? self :: PARAM_MULTIPART : self :: PARAM_FORM ; $ reverse_params_value = isset ( $ this -> configs [ $ reverse_params ] ) ? $ this -> configs [ $ reverse_params ] : null ; $ params_value = isset ( $ this -> configs [ $ type ] ) ? $ this -> configs [ $ type ] : null ; unset ( $ this -> configs [ self :: PARAM_FORM ] , $ this -> configs [ self :: PARAM_MULTIPART ] ) ; $ this -> configs [ $ type ] = is_array ( $ reverse_params_value ) ? $ reverse_params_value : ( is_array ( $ params_value ) ? $ params_value : [ ] ) ; return $ this -> buildConfigClient ( ) ; }
Set Param Type

@param string $type
@return static
@throws InvalidArgumentException
Set Param Type