add clear

This commit is contained in:
2021-04-06 15:20:39 +08:00
parent 80abb3a20a
commit bdafc011a6
23 changed files with 220 additions and 220 deletions
+8 -8
View File
@@ -30,33 +30,33 @@ abstract class Subject extends Miniprogarampage
}
/**
* @param string $templateId
* @param $templateId
*/
public function setTemplateId(string $templateId)
public function setTemplateId($templateId)
{
$this->templateId = $templateId;
}
/**
* @param string $openId
* @param $openId
*/
public function setOpenId(string $openId)
public function setOpenId($openId)
{
$this->openId = $openId;
}
/**
* @param string $page
* @param $page
*/
public function setPage(string $page)
public function setPage($page)
{
$this->page = $page;
}
/**
* @param string $emphasis_keyword
* @param $emphasis_keyword
*/
public function setEmphasisKeyword(string $emphasis_keyword)
public function setEmphasisKeyword($emphasis_keyword)
{
$this->emphasis_keyword = $emphasis_keyword;
}
+10 -10
View File
@@ -28,41 +28,41 @@ abstract class Template extends Miniprogarampage
}
/**
* @param string $templateId
* @param $templateId
*/
public function setTemplateId(string $templateId)
public function setTemplateId($templateId)
{
$this->templateId = $templateId;
}
/**
* @param string $formId
* @param $formId
*/
public function setFormId(string $formId)
public function setFormId($formId)
{
$this->formId = $formId;
}
/**
* @param string $openId
* @param $openId
*/
public function setOpenId(string $openId)
public function setOpenId($openId)
{
$this->openId = $openId;
}
/**
* @param string $page
* @param $page
*/
public function setPage(string $page)
public function setPage($page)
{
$this->page = $page;
}
/**
* @param string $emphasis_keyword
* @param $emphasis_keyword
*/
public function setEmphasisKeyword(string $emphasis_keyword)
public function setEmphasisKeyword($emphasis_keyword)
{
$this->emphasis_keyword = $emphasis_keyword;
}
+40 -40
View File
@@ -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;
}
+6 -6
View File
@@ -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 {
+7 -7
View File
@@ -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) {
+1 -1
View File
@@ -130,7 +130,7 @@ class Result
}
/**
* @param string $name
* @param $name
* @return mixed
*/
public function getData($name = '')
+6 -6
View File
@@ -132,7 +132,7 @@ class Material extends AfficialAccount
* @return mixed
* @throws Exception
*/
public function getMaterial(string $media_id)
public function getMaterial($media_id)
{
$this->request->setHost('api.weixin.qq.com');
$this->request->setErrorField('errcode');
@@ -154,7 +154,7 @@ class Material extends AfficialAccount
* @return mixed
* @throws Exception
*/
public function delMaterial(string $media_id)
public function delMaterial($media_id)
{
$this->request->setHost('api.weixin.qq.com');
$this->request->setErrorField('errcode');
@@ -172,13 +172,13 @@ class Material extends AfficialAccount
/**
* declare
* @param string $media_id
* @param $media_id
* @param int $index
* @param array $articles
* @return mixed
* @throws Exception
*/
public function modifyNewsMaterial(string $media_id, int $index, array $articles)
public function modifyNewsMaterial($media_id, int $index, array $articles)
{
$this->request->setHost('api.weixin.qq.com');
$this->request->setErrorField('errcode');
@@ -227,11 +227,11 @@ class Material extends AfficialAccount
* declare
* @param int $offset
* @param int $size
* @param string $type
* @param $type
* @return mixed
* @throws Exception
*/
public function getMaterialList(int $offset, int $size, string $type)
public function getMaterialList(int $offset, int $size, $type)
{
$this->request->setHost('api.weixin.qq.com');
$this->request->setErrorField('errcode');
+9 -9
View File
@@ -53,10 +53,10 @@ class NewsManager extends AfficialAccount
* <li>将消息密文和安全签名打包成xml格式</li>
* </ol>
*
* @param $replyMsg string 公众平台待回复用户的消息,xml格式的字符串
* @param $timeStamp string 时间戳,可以自己生成,也可以用URL参数的timestamp
* @param $nonce string 随机串,可以自己生成,也可以用URL参数的nonce
* @param &$encryptMsg string 加密后的可以直接回复用户的密文,包括msg_signature, timestamp, nonce, encrypt的xml格式的字符串,
* @param $replyMsg 公众平台待回复用户的消息,xml格式的字符串
* @param $timeStamp 时间戳,可以自己生成,也可以用URL参数的timestamp
* @param $nonce 随机串,可以自己生成,也可以用URL参数的nonce
* @param &$encryptMsg 加密后的可以直接回复用户的密文,包括msg_signature, timestamp, nonce, encrypt的xml格式的字符串,
* 当return返回0时有效
*
* @return int 成功0,失败返回对应的错误码
@@ -100,11 +100,11 @@ class NewsManager extends AfficialAccount
* <li>对消息进行解密</li>
* </ol>
*
* @param $msgSignature string 签名串,对应URL参数的msg_signature
* @param $timestamp string 时间戳 对应URL参数的timestamp
* @param $nonce string 随机串,对应URL参数的nonce
* @param $postData string 密文,对应POST请求的数据
* @param &$msg string 解密后的原文,当return返回0时有效
* @param $msgSignature 签名串,对应URL参数的msg_signature
* @param $timestamp 时间戳 对应URL参数的timestamp
* @param $nonce 随机串,对应URL参数的nonce
* @param $postData 密文,对应POST请求的数据
* @param &$msg 解密后的原文,当return返回0时有效
*
* @return int 成功0,失败返回对应的错误码
*/
+13 -13
View File
@@ -20,41 +20,41 @@ class Subscribe extends AfficialAccount
private $pushUrl = 'https://api.weixin.qq.com/cgi-bin/message/template/subscribe?access_token=';
/**
* @param string $openid
* @param $openid
* @return Subscribe
*/
public function setOpenid(string $openid): Subscribe
public function setOpenid($openid): Subscribe
{
$this->openid = $openid;
return $this;
}
/**
* @param string $template_id
* @param $template_id
* @return Subscribe
*/
public function setTemplateId(string $template_id): Subscribe
public function setTemplateId($template_id): Subscribe
{
$this->template_id = $template_id;
return $this;
}
/**
* @param string $url
* @param $url
* @return Subscribe
*/
public function setUrl(string $url): Subscribe
public function setUrl($url): Subscribe
{
$this->url = $url;
return $this;
}
/**
* @param string $appid
* @param string $path
* @param $appid
* @param $path
* @return Subscribe
*/
public function setMiniprogram(string $appid, string $path): Subscribe
public function setMiniprogram($appid, $path): Subscribe
{
$this->miniprogram['appid'] = $appid;
$this->miniprogram['pagepath'] = $path;
@@ -62,20 +62,20 @@ class Subscribe extends AfficialAccount
}
/**
* @param string $scene
* @param $scene
* @return Subscribe
*/
public function setScene(string $scene): Subscribe
public function setScene($scene): Subscribe
{
$this->scene = $scene;
return $this;
}
/**
* @param string $title
* @param $title
* @return Subscribe
*/
public function setTitle(string $title): Subscribe
public function setTitle($title): Subscribe
{
$this->title = $title;
return $this;
+1 -1
View File
@@ -102,7 +102,7 @@ class Prpcrypt
/**
* 随机生成16位字符串
* @return string 生成的字符串
* @return 生成的字符串
*/
function getRandomStr()
{
+1 -1
View File
@@ -10,7 +10,7 @@ class XMLParse
{
/**
* 提取出xml数据包中的加密消息
* @param string $xmltext 待提取的xml字符串
* @param $xmltext 待提取的xml字符串
* @return array 提取出的加密消息字符串
*/
public function extract($xmltext)
+5 -5
View File
@@ -26,21 +26,21 @@ class Recharge extends SmallProgram
private $uniformer = 'https://qpay.qq.com/cgi-bin/pay/qpay_unified_order.cgi';
/**
* @param string $value
* @param $value
*/
public function setSpillCreateIp(string $value)
public function setSpillCreateIp($value)
{
$this->spill_create_ip = $value;
}
/**
* @param int $money
* @param string $orderNo
* @param string $openId
* @param $orderNo
* @param $openId
* @return array|mixed|Result
* @throws
*/
public function recharge(int $money, string $orderNo, $openId = '')
public function recharge(int $money, $orderNo, $openId = '')
{
if ($money < 0) {
return new Result(['code' => 500, 'message' => '充值金额不能小于0.']);
+40 -40
View File
@@ -44,10 +44,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $key
* @param $key
* @return Redhat
*/
public function setKey(string $key): Redhat
public function setKey($key): Redhat
{
$this->key = $key;
return $this;
@@ -62,10 +62,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $signType
* @param $signType
* @return Redhat
*/
public function setSignType(string $signType): Redhat
public function setSignType($signType): Redhat
{
$this->signType = $signType;
return $this;
@@ -80,10 +80,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $charset
* @param $charset
* @return Redhat
*/
public function setCharset(string $charset): Redhat
public function setCharset($charset): Redhat
{
$this->charset = $charset;
return $this;
@@ -98,10 +98,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $nonce_str
* @param $nonce_str
* @return Redhat
*/
public function setNonceStr(string $nonce_str): Redhat
public function setNonceStr($nonce_str): Redhat
{
$this->nonce_str = $nonce_str;
return $this;
@@ -116,10 +116,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $sign
* @param $sign
* @return Redhat
*/
public function setSign(string $sign): Redhat
public function setSign($sign): Redhat
{
$this->sign = $sign;
return $this;
@@ -137,10 +137,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $mch_billno
* @param $mch_billno
* @return Redhat
*/
public function setMchBillno(string $mch_billno): Redhat
public function setMchBillno($mch_billno): Redhat
{
$this->mch_billno = $mch_billno;
return $this;
@@ -155,10 +155,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $mch_id
* @param $mch_id
* @return Redhat
*/
public function setMchId(string $mch_id): Redhat
public function setMchId($mch_id): Redhat
{
$this->mch_id = $mch_id;
return $this;
@@ -173,10 +173,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $mch_name
* @param $mch_name
* @return Redhat
*/
public function setMchName(string $mch_name): Redhat
public function setMchName($mch_name): Redhat
{
$this->mch_name = $mch_name;
return $this;
@@ -191,10 +191,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $qqappid
* @param $qqappid
* @return Redhat
*/
public function setQqappid(string $qqappid): Redhat
public function setQqappid($qqappid): Redhat
{
$this->qqappid = $qqappid;
return $this;
@@ -209,10 +209,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $re_openid
* @param $re_openid
* @return Redhat
*/
public function setReOpenid(string $re_openid): Redhat
public function setReOpenid($re_openid): Redhat
{
$this->re_openid = $re_openid;
return $this;
@@ -227,10 +227,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $total_amount
* @param $total_amount
* @return Redhat
*/
public function setTotalAmount(string $total_amount): Redhat
public function setTotalAmount($total_amount): Redhat
{
$this->total_amount = $total_amount;
return $this;
@@ -245,10 +245,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $total_num
* @param $total_num
* @return Redhat
*/
public function setTotalNum(string $total_num): Redhat
public function setTotalNum($total_num): Redhat
{
$this->total_num = $total_num;
return $this;
@@ -263,10 +263,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $wishing
* @param $wishing
* @return Redhat
*/
public function setWishing(string $wishing): Redhat
public function setWishing($wishing): Redhat
{
$this->wishing = $wishing;
return $this;
@@ -281,10 +281,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $act_name
* @param $act_name
* @return Redhat
*/
public function setActName(string $act_name): Redhat
public function setActName($act_name): Redhat
{
$this->act_name = $act_name;
return $this;
@@ -299,10 +299,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $icon_id
* @param $icon_id
* @return Redhat
*/
public function setIconId(string $icon_id): Redhat
public function setIconId($icon_id): Redhat
{
$this->icon_id = $icon_id;
return $this;
@@ -317,10 +317,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $banner_id
* @param $banner_id
* @return Redhat
*/
public function setBannerId(string $banner_id): Redhat
public function setBannerId($banner_id): Redhat
{
$this->banner_id = $banner_id;
return $this;
@@ -335,10 +335,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $notify_url
* @param $notify_url
* @return Redhat
*/
public function setNotifyUrl(string $notify_url): Redhat
public function setNotifyUrl($notify_url): Redhat
{
$this->notify_url = $notify_url;
return $this;
@@ -353,10 +353,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $not_send_msg
* @param $not_send_msg
* @return Redhat
*/
public function setNotSendMsg(string $not_send_msg): Redhat
public function setNotSendMsg($not_send_msg): Redhat
{
$this->not_send_msg = $not_send_msg;
return $this;
@@ -371,10 +371,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $min_value
* @param $min_value
* @return Redhat
*/
public function setMinValue(string $min_value): Redhat
public function setMinValue($min_value): Redhat
{
$this->min_value = $min_value;
return $this;
@@ -389,10 +389,10 @@ class Redhat extends SmallProgram
}
/**
* @param string $max_value
* @param $max_value
* @return Redhat
*/
public function setMaxValue(string $max_value): Redhat
public function setMaxValue($max_value): Redhat
{
$this->max_value = $max_value;
return $this;
+1 -1
View File
@@ -18,7 +18,7 @@ class SecCheck extends SmallProgram
private $_msgUrl = '/api/json/security/MsgSecCheck?access_token=';
/**
* @param string $path
* @param $path
* @return array|Result|mixed
*/
public function image($path = '')
+9 -9
View File
@@ -17,7 +17,7 @@ use wchat\wx\SmallProgram;
class Cash_Bonus extends SmallProgram
{
public string $_cash = '/cgi-bin/hongbao/qpay_hb_mch_send.cgi';
public $_cash = '/cgi-bin/hongbao/qpay_hb_mch_send.cgi';
private array $_errors = [
'66228701' => '红包个数超出限制',
@@ -36,31 +36,31 @@ class Cash_Bonus extends SmallProgram
private array $_requestParams = [];
/**
* @param string $value
* @param $value
*/
public function setMchName(string $value)
public function setMchName($value)
{
$this->_requestParams['mch_name'] = $value;
}
/**
* @param string $value
* @param $value
*/
public function setActName(string $value)
public function setActName($value)
{
$this->_requestParams['act_name'] = $value;
}
/**
* @param string $value
* @param $value
*/
public function setWishing(string $value)
public function setWishing($value)
{
$this->_requestParams['wishing'] = $value;
}
/**
* @param string $value
* @param $value
*/
public function setIconId($value)
{
@@ -68,7 +68,7 @@ class Cash_Bonus extends SmallProgram
}
/**
* @param string $value
* @param $value
*/
public function setBannerId($value)
{
+6 -6
View File
@@ -39,25 +39,25 @@ class Enterprise_payment extends SmallProgram
private $_requestParams = [];
/**
* @param string $value
* @param $value
*/
public function setOpUserId(string $value)
public function setOpUserId($value)
{
$this->_requestParams['op_user_id'] = $value;
}
/**
* @param string $value
* @param $value
*/
public function setOpUserPassword(string $value)
public function setOpUserPassword($value)
{
$this->_requestParams['op_user_passwd'] = $value;
}
/**
* @param string $value
* @param $value
*/
public function setSpbillCreateIp(string $value)
public function setSpbillCreateIp($value)
{
$this->_requestParams['spbill_create_ip'] = $value;
}
+6 -6
View File
@@ -15,11 +15,11 @@ use wchat\common\Result;
class Account extends SmallProgram
{
private string $wxaqr = 'https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=';
private string $getwxacode = 'https://api.weixin.qq.com/wxa/getwxacode?access_token=';
private string $getwxacodeunlimit = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=';
private $wxaqr = 'https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=';
private $getwxacode = 'https://api.weixin.qq.com/wxa/getwxacode?access_token=';
private $getwxacodeunlimit = 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=';
private string $savePath = __DIR__ . '/../../Users/';
private $savePath = __DIR__ . '/../../Users/';
/**
@@ -130,7 +130,7 @@ class Account extends SmallProgram
* @param $width
* @param bool $is_hyaline
* @param bool $auto_color
* @param string $line_color
* @param $line_color
* @return array|mixed|Result
* @throws \Exception
*/
@@ -159,7 +159,7 @@ class Account extends SmallProgram
* @param $width
* @param bool $is_hyaline
* @param bool $auto_color
* @param string $line_color
* @param $line_color
* @return array|mixed|Result
* @throws \Exception
*/
+34 -34
View File
@@ -19,19 +19,19 @@ class Message extends SmallProgram
/**
* @param string $openid
* @param $openid
*/
public function setOpenid(string $openid)
public function setOpenid($openid)
{
$this->msgData['touser'] = $openid;
}
/**
* @param string $content
* @param $content
* @return Result
* @throws Exception
*/
public function sendTextNews(string $content)
public function sendTextNews($content)
{
$this->msgData['msgtype'] = 'text';
$this->msgData['text'] = ['content' => $content];
@@ -44,7 +44,7 @@ class Message extends SmallProgram
* @return Result
* @throws Exception
*/
public function sendImageNews(string $media_id)
public function sendImageNews($media_id)
{
$this->msgData['msgtype'] = 'image';
$this->msgData['image'] = ['media_id' => $media_id];
@@ -58,7 +58,7 @@ class Message extends SmallProgram
* @return Result
* @throws Exception
*/
public function sendVoiceNews(string $media_id)
public function sendVoiceNews($media_id)
{
$this->msgData['msgtype'] = 'voice';
$this->msgData['voice'] = ['media_id' => $media_id];
@@ -71,7 +71,7 @@ class Message extends SmallProgram
* @return Result
* @throws Exception
*/
public function sendMpNewsNews(string $media_id)
public function sendMpNewsNews($media_id)
{
$this->msgData['msgtype'] = 'mpnews';
$this->msgData['mpnews'] = ['media_id' => $media_id];
@@ -81,14 +81,14 @@ class Message extends SmallProgram
/**
* @param string $title
* @param string $description
* @param string $url
* @param string $picurl
* @param $title
* @param $description
* @param $url
* @param $picurl
* @return Result
* @throws Exception
*/
public function sendNewsNews(string $title, string $description, string $url, string $picurl)
public function sendNewsNews($title, $description, $url, $picurl)
{
$this->msgData['msgtype'] = 'news';
$this->msgData['news'] = ['articles' => [[
@@ -102,11 +102,11 @@ class Message extends SmallProgram
/**
* @param string $title
* @param $title
* @return Result
* @throws Exception
*/
public function sendCardNews(string $title)
public function sendCardNews($title)
{
$this->msgData['msgtype'] = 'wxcard';
$this->msgData['wxcard'] = ['card_id' => $title];
@@ -116,14 +116,14 @@ class Message extends SmallProgram
/**
* @param string $media_id
* @param string $thumb_media_id
* @param string $title
* @param string $description
* @param $media_id
* @param $thumb_media_id
* @param $title
* @param $description
* @return Result
* @throws Exception
*/
public function sendVideoNews(string $media_id, string $thumb_media_id, string $title, string $description)
public function sendVideoNews($media_id, $thumb_media_id, $title, $description)
{
$this->msgData['msgtype'] = 'video';
$this->msgData['video'] = ['media_id' => [
@@ -137,15 +137,15 @@ class Message extends SmallProgram
/**
* @param string $musicurl
* @param string $hqmusicurl
* @param string $thumb_media_id
* @param string $title
* @param string $description
* @param $musicurl
* @param $hqmusicurl
* @param $thumb_media_id
* @param $title
* @param $description
* @return Result
* @throws Exception
*/
public function sendMusicNews(string $musicurl, string $hqmusicurl, string $thumb_media_id, string $title, string $description)
public function sendMusicNews($musicurl, $hqmusicurl, $thumb_media_id, $title, $description)
{
$this->msgData['msgtype'] = 'music';
$this->msgData['music'] = [
@@ -160,13 +160,13 @@ class Message extends SmallProgram
/**
* @param string $head_content
* @param string $tail_content
* @param $head_content
* @param $tail_content
* @param array $menus
* @return Result
* @throws Exception
*/
public function sendMenuNews(string $head_content, string $tail_content, array $menus = [])
public function sendMenuNews($head_content, $tail_content, array $menus = [])
{
$this->msgData['msgtype'] = 'msgmenu';
$this->msgData['msgmenu'] = [
@@ -206,7 +206,7 @@ class Message extends SmallProgram
* @return Result
* @throws Exception
*/
public function sendMiniprogrampageNews(string $title, string $appid, string $pagepath, string $thumb_media_id)
public function sendMiniprogrampageNews($title, $appid, $pagepath, $thumb_media_id)
{
$this->msgData['msgtype'] = 'msgmenu';
$this->msgData['miniprogrampage'] = [
@@ -219,15 +219,15 @@ class Message extends SmallProgram
}
/**
* @param string $filePath
* @param string $type
* @param $filePath
* @param $type
* @param bool $isPermanent
* @param string $title
* @param string $introduction
* @param $title
* @param $introduction
* @return mixed
* @throws Exception
*/
public function upload(string $filePath, string $type, $isPermanent = false, string $title = '', string $introduction = '')
public function upload($filePath, $type, $isPermanent = false, $title = '', $introduction = '')
{
if (!file_exists($filePath)) {
throw new Exception('文件不存在');
+9 -9
View File
@@ -32,25 +32,25 @@ class PublicTemplate extends SmallProgram
}
/**
* @param string $templateId
* @param $templateId
*/
public function setTemplateId(string $templateId)
public function setTemplateId($templateId)
{
$this->templateId = $templateId;
}
/**
* @param string $openId
* @param $openId
*/
public function setOpenId(string $openId)
public function setOpenId($openId)
{
$this->openId = $openId;
}
/**
* @param string $defaultUrl
* @param $defaultUrl
*/
public function setDefaultUrl(string $defaultUrl)
public function setDefaultUrl($defaultUrl)
{
$this->defaultUrl = $defaultUrl;
}
@@ -58,7 +58,7 @@ class PublicTemplate extends SmallProgram
/**
* @param $name
* @param $context
* @param string $color
* @param $color
*/
public function replaceKeyword($name, $context, $color = '')
{
@@ -84,7 +84,7 @@ class PublicTemplate extends SmallProgram
/**
* @param $context
* @param string $color
* @param $color
*/
public function setFirst($context, $color = '#f00')
{
@@ -96,7 +96,7 @@ class PublicTemplate extends SmallProgram
/**
* @param $context
* @param string $color
* @param $color
*/
public function setRemark($context, $color = '#000')
{
+3 -3
View File
@@ -29,12 +29,12 @@ class Recharge extends SmallProgram
/**
* @param int $money
* @param string $orderNo
* @param string $openId
* @param $orderNo
* @param $openId
* @return array|mixed|Result
* @throws
*/
public function recharge(int $money, string $orderNo, $openId = '')
public function recharge(int $money, $orderNo, $openId = '')
{
if ($money < 0) {
return new Result(['code' => 500, 'message' => '充值金额不能小于0.']);
+3 -3
View File
@@ -23,7 +23,7 @@ class SecCheck extends SmallProgram
const MEDIA_IMAGE = 1;
/**
* @param string $path
* @param $path
* @return array|Result|mixed
*/
public function image($path = '')
@@ -41,12 +41,12 @@ class SecCheck extends SmallProgram
/**
* @param string $url
* @param $url
* @param int $type
* @return mixed
* @throws
*/
public function mediaAsync(string $url, $type = SecCheck::MEDIA_IMAGE)
public function mediaAsync($url, $type = SecCheck::MEDIA_IMAGE)
{
if (!in_array($type, [self::MEDIA_IMAGE, self::MEDIA_VIDEO])) {
throw new \Exception('暂不支持的文件类型');
+1 -1
View File
@@ -13,7 +13,7 @@ use wchat\common\Result;
class Subject extends \wchat\base\Subject
{
private string $sendUrl = 'https://api.weixin.qq.com/cgi-bin/message/subscribe/send';
private $sendUrl = 'https://api.weixin.qq.com/cgi-bin/message/subscribe/send';
/**
* @return string
+1 -1
View File
@@ -14,7 +14,7 @@ namespace wchat\wx;
*/
class Template extends \wchat\base\Template
{
private string $sendUrl = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send';
private $sendUrl = 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send';
public function getUrl()
{