Completed
Push — master ( 49cacf...a87b05 )
by Songda
02:09
created
src/Gateways/Wechat/Support.php 1 patch
Spacing   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
         $payload['appid'] = self::$instance->getConfig($type, '');
232 232
 
233 233
         if (self::$instance->getConfig('mode', Wechat::MODE_NORMAL) === Wechat::MODE_SERVICE) {
234
-            $payload['sub_appid'] = self::$instance->getConfig('sub_'.$type, '');
234
+            $payload['sub_appid'] = self::$instance->getConfig('sub_' . $type, '');
235 235
         }
236 236
 
237 237
         unset($payload['trade_type'], $payload['type']);
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 
266 266
         ksort($data);
267 267
 
268
-        $string = md5(self::getSignContent($data).'&key='.$key);
268
+        $string = md5(self::getSignContent($data) . '&key=' . $key);
269 269
 
270 270
         Log::debug('Wechat Generate Sign Before UPPER', [$data, $string]);
271 271
 
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
         $buff = '';
287 287
 
288 288
         foreach ($data as $k => $v) {
289
-            $buff .= ($k != 'sign' && $v != '' && !is_array($v)) ? $k.'='.$v.'&' : '';
289
+            $buff .= ($k != 'sign' && $v != '' && !is_array($v)) ? $k . '=' . $v . '&' : '';
290 290
         }
291 291
 
292 292
         Log::debug('Wechat Generate Sign Content Before Trim', [$data, $buff]);
@@ -332,8 +332,7 @@  discard block
 block discarded – undo
332 332
 
333 333
         $xml = '<xml>';
334 334
         foreach ($data as $key => $val) {
335
-            $xml .= is_numeric($val) ? '<'.$key.'>'.$val.'</'.$key.'>' :
336
-                                       '<'.$key.'><![CDATA['.$val.']]></'.$key.'>';
335
+            $xml .= is_numeric($val) ? '<' . $key . '>' . $val . '</' . $key . '>' : '<' . $key . '><![CDATA[' . $val . ']]></' . $key . '>';
337 336
         }
338 337
         $xml .= '</xml>';
339 338
 
@@ -404,7 +403,7 @@  discard block
 block discarded – undo
404 403
                 $type = 'appid';
405 404
                 break;
406 405
             default:
407
-                $type = $type.'_id';
406
+                $type = $type . '_id';
408 407
         }
409 408
 
410 409
         return $type;
@@ -440,14 +439,14 @@  discard block
 block discarded – undo
440 439
     {
441 440
         if (!isset($result['return_code']) || $result['return_code'] != 'SUCCESS') {
442 441
             throw new GatewayException(
443
-                'Get Wechat API Error:'.($result['return_msg'] ?? $result['retmsg']),
442
+                'Get Wechat API Error:' . ($result['return_msg'] ?? $result['retmsg']),
444 443
                 $result
445 444
             );
446 445
         }
447 446
 
448 447
         if (isset($result['result_code']) && $result['result_code'] != 'SUCCESS') {
449 448
             throw new BusinessException(
450
-                'Wechat Business Error: '.$result['err_code'].' - '.$result['err_code_des'],
449
+                'Wechat Business Error: ' . $result['err_code'] . ' - ' . $result['err_code_des'],
451 450
                 $result
452 451
             );
453 452
         }
Please login to merge, or discard this patch.