add clear
This commit is contained in:
+40
-40
@@ -124,10 +124,10 @@ class Config
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $ssl_ca
|
||||
* @param $ssl_ca
|
||||
* @return Config
|
||||
*/
|
||||
public function setSslCa(string $ssl_ca): Config
|
||||
public function setSslCa($ssl_ca): Config
|
||||
{
|
||||
$this->ssl_ca = $ssl_ca;
|
||||
return $this;
|
||||
@@ -142,10 +142,10 @@ class Config
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $port
|
||||
* @param $port
|
||||
* @return Config
|
||||
*/
|
||||
public function setPort(string $port): Config
|
||||
public function setPort($port): Config
|
||||
{
|
||||
$this->port = $port;
|
||||
return $this;
|
||||
@@ -178,10 +178,10 @@ class Config
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $agent
|
||||
* @param $agent
|
||||
* @return Config
|
||||
*/
|
||||
public function setAgent(string $agent): Config
|
||||
public function setAgent($agent): Config
|
||||
{
|
||||
$this->agent = $agent;
|
||||
return $this;
|
||||
@@ -232,65 +232,65 @@ class Config
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $access_token
|
||||
* @param $access_token
|
||||
*/
|
||||
public function setAccessToken(string $access_token)
|
||||
public function setAccessToken($access_token)
|
||||
{
|
||||
$this->access_token = $access_token;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $remote_addr
|
||||
* @param $remote_addr
|
||||
*/
|
||||
public function setRemoteAddr(string $remote_addr)
|
||||
public function setRemoteAddr($remote_addr)
|
||||
{
|
||||
$this->remote_addr = $remote_addr;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $appid
|
||||
* @param $appid
|
||||
*/
|
||||
public function setAppid(string $appid)
|
||||
public function setAppid($appid)
|
||||
{
|
||||
$this->appid = $appid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $mch_id
|
||||
* @param $mch_id
|
||||
*/
|
||||
public function setMchId(string $mch_id)
|
||||
public function setMchId($mch_id)
|
||||
{
|
||||
$this->mch_id = $mch_id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $device_info
|
||||
* @param $device_info
|
||||
*/
|
||||
public function setDeviceInfo(string $device_info)
|
||||
public function setDeviceInfo($device_info)
|
||||
{
|
||||
$this->device_info = $device_info;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $nonce_str
|
||||
* @param $nonce_str
|
||||
*/
|
||||
public function setNonceStr(string $nonce_str)
|
||||
public function setNonceStr($nonce_str)
|
||||
{
|
||||
$this->nonce_str = $nonce_str;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $body
|
||||
* @param $body
|
||||
*/
|
||||
public function setBody(string $body)
|
||||
public function setBody($body)
|
||||
{
|
||||
$this->body = $body;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $out_trade_no
|
||||
* @param $out_trade_no
|
||||
*/
|
||||
public function setOutTradeNo(string $out_trade_no)
|
||||
public function setOutTradeNo($out_trade_no)
|
||||
{
|
||||
$this->out_trade_no = $out_trade_no;
|
||||
}
|
||||
@@ -304,73 +304,73 @@ class Config
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $spbill_create_ip
|
||||
* @param $spbill_create_ip
|
||||
*/
|
||||
public function setSpbillCreateIp(string $spbill_create_ip)
|
||||
public function setSpbillCreateIp($spbill_create_ip)
|
||||
{
|
||||
$this->spbill_create_ip = $spbill_create_ip;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $notify_url
|
||||
* @param $notify_url
|
||||
*/
|
||||
public function setNotifyUrl(string $notify_url)
|
||||
public function setNotifyUrl($notify_url)
|
||||
{
|
||||
$this->notify_url = $notify_url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $trade_type
|
||||
* @param $trade_type
|
||||
*/
|
||||
public function setTradeType(string $trade_type)
|
||||
public function setTradeType($trade_type)
|
||||
{
|
||||
$this->trade_type = $trade_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sign_type
|
||||
* @param $sign_type
|
||||
*/
|
||||
public function setSignType(string $sign_type)
|
||||
public function setSignType($sign_type)
|
||||
{
|
||||
$this->sign_type = $sign_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $mch_host
|
||||
* @param $mch_host
|
||||
*/
|
||||
public function setMchHost(string $mch_host)
|
||||
public function setMchHost($mch_host)
|
||||
{
|
||||
$this->mch_host = $mch_host;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $appsecret
|
||||
* @param $appsecret
|
||||
*/
|
||||
public function setAppsecret(string $appsecret)
|
||||
public function setAppsecret($appsecret)
|
||||
{
|
||||
$this->appsecret = $appsecret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $ssl_cert
|
||||
* @param $ssl_cert
|
||||
*/
|
||||
public function setSslCert(string $ssl_cert)
|
||||
public function setSslCert($ssl_cert)
|
||||
{
|
||||
$this->ssl_cert = $ssl_cert;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $ssl_key
|
||||
* @param $ssl_key
|
||||
*/
|
||||
public function setSslKey(string $ssl_key)
|
||||
public function setSslKey($ssl_key)
|
||||
{
|
||||
$this->ssl_key = $ssl_key;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $key
|
||||
* @param $key
|
||||
*/
|
||||
public function setKey(string $key)
|
||||
public function setKey($key)
|
||||
{
|
||||
$this->key = $key;
|
||||
}
|
||||
|
||||
@@ -36,17 +36,17 @@ class Help extends Miniprogarampage
|
||||
*/
|
||||
private static function xmlChild(array $array)
|
||||
{
|
||||
$string = '';
|
||||
$= '';
|
||||
foreach ($array as $key => $value) {
|
||||
if (is_array($value)) {
|
||||
$string .= static::xmlChild($value);
|
||||
$.= static::xmlChild($value);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_numeric($value)) {
|
||||
$string .= "<" . $key . ">" . $value . "</" . $key . ">";
|
||||
$.= "<" . $key . ">" . $value . "</" . $key . ">";
|
||||
} else {
|
||||
$string .= "<" . $key . "><![CDATA[" . $value . "]]></" . $key . ">";
|
||||
$.= "<" . $key . "><![CDATA[" . $value . "]]></" . $key . ">";
|
||||
}
|
||||
}
|
||||
return $string;
|
||||
@@ -163,7 +163,7 @@ class Help extends Miniprogarampage
|
||||
public static function sign(array $array, $key, $type)
|
||||
{
|
||||
ksort($array, SORT_ASC);
|
||||
$string = [];
|
||||
$= [];
|
||||
foreach ($array as $hashKey => $val) {
|
||||
if (empty($val)) {
|
||||
continue;
|
||||
@@ -171,7 +171,7 @@ class Help extends Miniprogarampage
|
||||
$string[] = $hashKey . '=' . $val;
|
||||
}
|
||||
$string[] = 'key=' . $key;
|
||||
$string = implode('&', $string);
|
||||
$= implode('&', $string);
|
||||
if ($type == 'MD5') {
|
||||
return strtoupper(md5($string));
|
||||
} else {
|
||||
|
||||
@@ -328,35 +328,35 @@ class HttpClient
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $_string
|
||||
* @param $_string
|
||||
* @return bool|string
|
||||
* @throws Exception
|
||||
*/
|
||||
private function matchHost($_string = '')
|
||||
private function matchHost($_= '')
|
||||
{
|
||||
if (empty($_string)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->isHttp($_string)) {
|
||||
$_string = str_replace('http://', '', $_string);
|
||||
$_= str_replace('http://', '', $_string);
|
||||
$hostAndUrls = explode('/', $_string);
|
||||
|
||||
$this->host = array_shift($hostAndUrls);
|
||||
$_string = implode('/', $hostAndUrls);
|
||||
$_= implode('/', $hostAndUrls);
|
||||
} else if ($this->isHttps($_string)) {
|
||||
$_string = str_replace('https://', '', $_string);
|
||||
$_= str_replace('https://', '', $_string);
|
||||
$this->setIsSSL(true);
|
||||
|
||||
$hostAndUrls = explode('/', $_string);
|
||||
|
||||
$this->host = array_shift($hostAndUrls);
|
||||
$_string = implode('/', $hostAndUrls);
|
||||
$_= implode('/', $hostAndUrls);
|
||||
} else if (empty($this->host)) {
|
||||
$hostAndUrls = explode('/', $_string);
|
||||
$this->host = array_shift($hostAndUrls);
|
||||
|
||||
$_string = implode('/', $hostAndUrls);
|
||||
$_= implode('/', $hostAndUrls);
|
||||
}
|
||||
|
||||
if (strpos($this->host, ':') !== false) {
|
||||
|
||||
@@ -130,7 +130,7 @@ class Result
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param $name
|
||||
* @return mixed
|
||||
*/
|
||||
public function getData($name = '')
|
||||
|
||||
Reference in New Issue
Block a user