Build write params
@param array $params
@return array
183429
protected static function _buildWriteParams($params = array()) {
		$writeParams['equalKeysOnly'] = (
			isset($params['equalKeysOnly']) &&
			empty($params['equalKeysOnly']) ? false : true
		);

		return $writeParams;
	}
893764
protected function buildFormParams(array $params, $action)
    {
        $params = $this->addCommonParams($params, $action);

        return $this->addSignature($params);
    }
551685
private function saveInputParams($params){
		foreach($params as $param => $value){
			$var = "_" . $param;

			if(!isset($this->{$var}) || !is_null($this->{$var})){
				$this->{$var} = $value;
			}
		}

		return $this;
	}
865258
public function buildPaymentParameter($params = [])
    {
        $defaultParams = [
            'appid' => $this->appId,
            'mch_id' => $this->mchId,
            'nonce_str' => bin2hex(openssl_random_pseudo_bytes(8)),
            'notify_url' => $this->getNoticeUrl(),
            'device_info' => isset($this->deviceInfoMap[$params['trade_type']]) ? $this->deviceInfoMap[$params['trade_type']] : 'WEB',
        ];
        return array_merge($defaultParams, $params);
    }
807372
protected function buildQueryString(array $params)
    {
        $qs = "";
        foreach ($params as $key => $value) {
            if ($qs === "") {
                $qs = "?";
            } else {
                $qs .= "&&";
            }
            $qs .= $key . "=" . $value;
        }
        return $qs;
    }
1054435
public function getAllParams(array $params)
    {
        $all = $this->defaults;

        if (isset($params['p'])) {
            foreach (explode(',', $params['p']) as $preset) {
                if (isset($this->presets[$preset])) {
                    $all = array_merge($all, $this->presets[$preset]);
                }
            }
        }

        return array_merge($all, $params);
    }
483816
private function getNestedParams(array $params)
    {
        $query = http_build_query($params, null, '&');
        $params = explode('&', $query);
        $result = [];

        foreach ($params as $param) {
            list($key, $value) = explode('=', $param, 2);
            $result[urldecode($key)] = urldecode($value);
        }

        return $result;
    }
754270
protected function getMergedWriteParams($params = [])
    {
        $defaults = [
            'background' => false,
            'color'      => false,
            'bold'       => false,
            'underline'  => false,
        ];

        return array_merge($defaults, $params);
    }
1170074
public function getRealParams(array $params)
    {
        foreach ($params as $k => $p) {
            if (is_array($p)) {
                $params[$k] = $p[1];
            }
        }

        return $params;
    }
832269
public function setParamsSort(array $params) {
        if (is_numeric(key($params)) && key($params) == 0) {
            $tmp = [];
            foreach ($params as $key => $value) {
                $tmp[$key + 1] = $value;
            }
            $params = $tmp;
        }

        return $params;
    }
620476
private function constructPdoDsn(array $params)
    {
        $dsn = 'oci:dbname=' . $this->getEasyConnectString($params);

        if (isset($params['charset'])) {
            $dsn .= ';charset=' . $params['charset'];
        }

        return $dsn;
    }
158356
public function createStreamFromArray(array $params)
    {
        $string = "";
        foreach ($params as $key => $value) {
            $string .= $key . '=' . urlencode(trim($value)) . '&';
        }

        $string = rtrim($string, "&");

        return $this->createStream($string);
    }
870339
protected function formatKVLists(array $params)
    {
        $formatted = [];

        foreach ($params as $name => $value) {
            $formatted[] = [
                'key' => $name,
                'value' => strval($value),
            ];
        }

        return $formatted;
    }
469197
public function buildAuthUrl(array $params = [])
    {
        $defaultParams = [
            'appid' => $this->clientId,
            'response_type' => 'code',
            'redirect_uri' => $this->getReturnUrl(),
        ];
        if (!empty($this->scope)) {
            $defaultParams['scope'] = $this->scope;
        }

        if ($this->validateAuthState) {
            $authState = $this->generateAuthState();
            $this->setState('authState', $authState);
            $defaultParams['state'] = $authState;
        }

        return $this->composeUrl($this->authUrl, array_merge($defaultParams, $params));
    }
1350506
public function buildPaymentParameter($params = [])
    {
        $defaultParams = [
            'service' => "create_direct_pay_by_user",
            'partner' => $this->partner,
            'seller_email' => $this->seller_email,
            'payment_type' => 1,
            'notify_url' => $this->getNoticeUrl(),
            'return_url' => $this->getReturnUrl(),
            'anti_phishing_key' => '',
            'exter_invoke_ip' => Yii::$app->request->userIP,
            '_input_charset' => strtolower($this->charset),
        ];
        return array_merge($defaultParams, $params);
    }
772393
public function build($params)
    {
        return ((isset($params['scheme'])) ? $params['scheme'] . '://' : '')
            . ((isset($params['user'])) ? $params['user'] . ((isset($params['pass'])) ? ':' . $params['pass'] : '') . '@' : '')
            . ((isset($params['host'])) ? $params['host'] : '')
            . ((isset($params['port'])) ? ':' . $params['port'] : '')
            . ((isset($params['path'])) ? $params['path'] : '')
            . ((isset($params['query'])) ? '?' . $params['query'] : '')
            . ((isset($params['fragment'])) ? '#' . $params['fragment'] : '');
    }
450611
private function decorateArrayValue(array $params) : string
    {
        $params_out = [];
        foreach($params as $key => $param) {
            if (is_string($key)){
                $params_out[] = "'$key' =>" . $this->decorateValue($param);
            }
            else{
                $params_out[] = $this->decorateValue($param);
            }
        }
        return '[' . implode(',',$params_out) . ']';
    }