@@ -11,13 +11,13 @@ |
||
11 | 11 | { |
12 | 12 | const API_MESSAGE_SEND = 'https://qyapi.weixin.qq.com/cgi-bin/message/send'; |
13 | 13 | |
14 | - const MSG_TYPE_TEXT = 'text'; // 文本 |
|
15 | - const MSG_TYPE_NEWS = 'news'; // 图文 |
|
16 | - const MSG_TYPE_VOICE = 'voice'; // 语音 |
|
17 | - const MSG_TYPE_IMAGE = 'image'; // 图片 |
|
18 | - const MSG_TYPE_VIDEO = 'video'; // 视频 |
|
19 | - const MSG_TYPE_CARD = 'card'; // 卡券 |
|
20 | - const MSG_TYPE_FILE = 'file'; // 文件 |
|
14 | + const MSG_TYPE_TEXT = 'text'; // 文本 |
|
15 | + const MSG_TYPE_NEWS = 'news'; // 图文 |
|
16 | + const MSG_TYPE_VOICE = 'voice'; // 语音 |
|
17 | + const MSG_TYPE_IMAGE = 'image'; // 图片 |
|
18 | + const MSG_TYPE_VIDEO = 'video'; // 视频 |
|
19 | + const MSG_TYPE_CARD = 'card'; // 卡券 |
|
20 | + const MSG_TYPE_FILE = 'file'; // 文件 |
|
21 | 21 | const MSG_TYPE_MPNEWS = 'mpnews'; // 图文 |
22 | 22 | const MSG_TYPE_TEXTCARD = 'textcard'; // 文本卡片 |
23 | 23 |
@@ -138,8 +138,8 @@ discard block |
||
138 | 138 | */ |
139 | 139 | protected function accessTokenMiddleware() |
140 | 140 | { |
141 | - return function (callable $handler) { |
|
142 | - return function (RequestInterface $request, array $options) use ($handler) { |
|
141 | + return function(callable $handler) { |
|
142 | + return function(RequestInterface $request, array $options) use ($handler) { |
|
143 | 143 | if (!$this->accessToken) { |
144 | 144 | return $handler($request, $options); |
145 | 145 | } |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | */ |
162 | 162 | protected function logMiddleware() |
163 | 163 | { |
164 | - return Middleware::tap(function (RequestInterface $request, $options) { |
|
164 | + return Middleware::tap(function(RequestInterface $request, $options) { |
|
165 | 165 | Log::debug("Request: {$request->getMethod()} {$request->getUri()} ".json_encode($options)); |
166 | 166 | Log::debug('Request headers:'.json_encode($request->getHeaders())); |
167 | 167 | }); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | protected function retryMiddleware() |
176 | 176 | { |
177 | - return Middleware::retry(function ( |
|
177 | + return Middleware::retry(function( |
|
178 | 178 | $retries, |
179 | 179 | RequestInterface $request, |
180 | 180 | ResponseInterface $response = null |
@@ -168,7 +168,7 @@ |
||
168 | 168 | $return = []; |
169 | 169 | array_walk_recursive( |
170 | 170 | $array, |
171 | - function ($x) use (&$return) { |
|
171 | + function($x) use (&$return) { |
|
172 | 172 | $return[] = $x; |
173 | 173 | } |
174 | 174 | ); |
@@ -98,7 +98,7 @@ |
||
98 | 98 | $articles = [$articles]; |
99 | 99 | } |
100 | 100 | |
101 | - $params = ['articles' => array_map(function ($article) { |
|
101 | + $params = ['articles' => array_map(function($article) { |
|
102 | 102 | if ($article instanceof Article) { |
103 | 103 | return $article->only([ |
104 | 104 | 'title', 'thumb_media_id', 'author', 'digest', |
@@ -17,14 +17,14 @@ |
||
17 | 17 | const API_SEND = 'https://qyapi.weixin.qq.com/cgi-bin/chat/send'; |
18 | 18 | const API_SET_MUTE = 'https://qyapi.weixin.qq.com/cgi-bin/chat/setmute'; |
19 | 19 | |
20 | - const CHAT_TYPE_SINGLE = 'single'; // 单聊 |
|
21 | - const CHAT_TYPE_GROUP = 'group'; // 群聊 |
|
22 | - |
|
23 | - const MSG_TYPE_TEXT = 'text'; // 文本 |
|
24 | - const MSG_TYPE_VOICE = 'voice'; // 语音 |
|
25 | - const MSG_TYPE_IMAGE = 'image'; // 图片 |
|
26 | - const MSG_TYPE_FILE = 'file'; // 文件 |
|
27 | - const MSG_TYPE_LINK = 'link'; // 文件 |
|
20 | + const CHAT_TYPE_SINGLE = 'single'; // 单聊 |
|
21 | + const CHAT_TYPE_GROUP = 'group'; // 群聊 |
|
22 | + |
|
23 | + const MSG_TYPE_TEXT = 'text'; // 文本 |
|
24 | + const MSG_TYPE_VOICE = 'voice'; // 语音 |
|
25 | + const MSG_TYPE_IMAGE = 'image'; // 图片 |
|
26 | + const MSG_TYPE_FILE = 'file'; // 文件 |
|
27 | + const MSG_TYPE_LINK = 'link'; // 文件 |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Fetch a chat by chat id. |