Completed
Push — master ( 80f9c1...347ac3 )
by Songda
19:24
created
src/Gateways/Wechat/Support.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@
 block discarded – undo
189 189
      *
190 190
      * @author yansongda <[email protected]>
191 191
      *
192
-     * @param       $endpoint
192
+     * @param       string $endpoint
193 193
      * @param array $result
194 194
      *
195 195
      * @throws GatewayException
Please login to merge, or discard this patch.
Spacing   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
     {
203 203
         if (!isset($result['return_code']) || $result['return_code'] != 'SUCCESS' || $result['result_code'] != 'SUCCESS') {
204 204
             throw new GatewayException(
205
-                'Get Wechat API Error:'.($result['return_msg'] ?? $result['retmsg']).($result['err_code_des'] ?? ''),
205
+                'Get Wechat API Error:' . ($result['return_msg'] ?? $result['retmsg']) . ($result['err_code_des'] ?? ''),
206 206
                 $result,
207 207
                 20000
208 208
             );
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
         $payload['appid'] = self::$instance->getConfig($type, '');
242 242
 
243 243
         if (self::$instance->getConfig('mode', Wechat::MODE_NORMAL) === Wechat::MODE_SERVICE) {
244
-            $payload['sub_appid'] = self::$instance->getConfig('sub_'.$type, '');
244
+            $payload['sub_appid'] = self::$instance->getConfig('sub_' . $type, '');
245 245
         }
246 246
 
247 247
         unset($payload['trade_type'], $payload['type']);
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 
276 276
         ksort($data);
277 277
 
278
-        $string = md5(self::getSignContent($data).'&key='.$key);
278
+        $string = md5(self::getSignContent($data) . '&key=' . $key);
279 279
 
280 280
         Log::debug('Wechat Generate Sign Before UPPER', [$data, $string]);
281 281
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
         $buff = '';
297 297
 
298 298
         foreach ($data as $k => $v) {
299
-            $buff .= ($k != 'sign' && $v != '' && !is_array($v)) ? $k.'='.$v.'&' : '';
299
+            $buff .= ($k != 'sign' && $v != '' && !is_array($v)) ? $k . '=' . $v . '&' : '';
300 300
         }
301 301
 
302 302
         Log::debug('Wechat Generate Sign Content Before Trim', [$data, $buff]);
@@ -342,8 +342,7 @@  discard block
 block discarded – undo
342 342
 
343 343
         $xml = '<xml>';
344 344
         foreach ($data as $key => $val) {
345
-            $xml .= is_numeric($val) ? '<'.$key.'>'.$val.'</'.$key.'>' :
346
-                                       '<'.$key.'><![CDATA['.$val.']]></'.$key.'>';
345
+            $xml .= is_numeric($val) ? '<' . $key . '>' . $val . '</' . $key . '>' : '<' . $key . '><![CDATA[' . $val . ']]></' . $key . '>';
347 346
         }
348 347
         $xml .= '</xml>';
349 348
 
@@ -414,7 +413,7 @@  discard block
 block discarded – undo
414 413
                 $type = 'appid';
415 414
                 break;
416 415
             default:
417
-                $type = $type.'_id';
416
+                $type = $type . '_id';
418 417
         }
419 418
 
420 419
         return $type;
Please login to merge, or discard this patch.