Skip to content

Commit

Permalink
some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
thenbsp committed Nov 27, 2017
1 parent 0c92bb1 commit 716bcb0
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 27 deletions.
4 changes: 3 additions & 1 deletion src/Bridge/CacheTrait.php 100644 → 100755
Expand Up @@ -2,6 +2,8 @@

namespace Thenbsp\Wechat\Bridge;

use Doctrine\Common\Cache\Cache;

trait CacheTrait
{
/**
Expand All @@ -12,7 +14,7 @@ trait CacheTrait
/**
* 设置缓存驱动.
*/
public function setCache(\Doctrine\Common\Cache\Cache $cache)
public function setCache(Cache $cache)
{
$this->cache = $cache;
}
Expand Down
21 changes: 0 additions & 21 deletions src/Bridge/Util.php 100644 → 100755
Expand Up @@ -52,25 +52,4 @@ public static function getRandomString($length = 10)

return substr(str_shuffle(str_repeat($pool, ceil($length / strlen($pool)))), 0, $length);
}

/**
* 过滤微信昵称中的表情(不过滤 HTML 符号).
*/
public static function filterNickname($nickname)
{
$pattern = [
'/\xEE[\x80-\xBF][\x80-\xBF]/',
'/\xEF[\x81-\x83][\x80-\xBF]/',
'/[\x{1F600}-\x{1F64F}]/u',
'/[\x{1F300}-\x{1F5FF}]/u',
'/[\x{1F680}-\x{1F6FF}]/u',
'/[\x{2600}-\x{26FF}]/u',
'/[\x{2700}-\x{27BF}]/u',
'/[\x{20E3}]/u',
];

$nickname = preg_replace($pattern, '', $nickname);

return trim($nickname);
}
}
2 changes: 1 addition & 1 deletion src/Wechat/AccessToken.php 100644 → 100755
Expand Up @@ -14,7 +14,7 @@ class AccessToken extends ArrayCollection
use CacheTrait;

/**
* http://mp.weixin.qq.com/wiki/14/9f9c82c1af308e3b14ba9b973f99a8ba.html.
* @see http://mp.weixin.qq.com/wiki/14/9f9c82c1af308e3b14ba9b973f99a8ba.html.
*/
const ACCESS_TOKEN = 'https://api.weixin.qq.com/cgi-bin/token';

Expand Down
2 changes: 1 addition & 1 deletion src/Wechat/Jsapi/Ticket.php 100644 → 100755
Expand Up @@ -14,7 +14,7 @@ class Ticket
use CacheTrait;

/**
* http://mp.weixin.qq.com/wiki/11/74ad127cc054f6b80759c40f77ec03db.html(附录 1).
* @see http://mp.weixin.qq.com/wiki/11/74ad127cc054f6b80759c40f77ec03db.html(附录 1).
*/
const JSAPI_TICKET = 'https://api.weixin.qq.com/cgi-bin/ticket/getticket';

Expand Down
2 changes: 1 addition & 1 deletion src/Wechat/Qrcode/Ticket.php 100644 → 100755
Expand Up @@ -14,7 +14,7 @@ class Ticket
use CacheTrait;

/**
* http://mp.weixin.qq.com/wiki/18/167e7d94df85d8389df6c94a7a8f78ba.html.
* @see http://mp.weixin.qq.com/wiki/18/167e7d94df85d8389df6c94a7a8f78ba.html.
*/
const TICKET_URL = 'https://api.weixin.qq.com/cgi-bin/qrcode/create';

Expand Down
2 changes: 1 addition & 1 deletion src/Wechat/ServerIp.php 100644 → 100755
Expand Up @@ -13,7 +13,7 @@ class ServerIp
use CacheTrait;

/**
* http://mp.weixin.qq.com/wiki/4/41ef0843d6e108cf6b5649480207561c.html.
* @see http://mp.weixin.qq.com/wiki/4/41ef0843d6e108cf6b5649480207561c.html.
*/
const SERVER_IP = 'https://api.weixin.qq.com/cgi-bin/getcallbackip';

Expand Down
2 changes: 1 addition & 1 deletion src/Wechat/ShortUrl.php 100644 → 100755
Expand Up @@ -13,7 +13,7 @@ class ShortUrl
use CacheTrait;

/**
* http://mp.weixin.qq.com/wiki/6/856aaeb492026466277ea39233dc23ee.html.
* @see http://mp.weixin.qq.com/wiki/6/856aaeb492026466277ea39233dc23ee.html.
*/
const SHORT_URL = 'https://api.weixin.qq.com/cgi-bin/shorturl';

Expand Down

0 comments on commit 716bcb0

Please sign in to comment.