Completed
Push — master ( 347ac3...226098 )
by Songda
03:44
created
src/Gateways/Wechat/Support.php 1 patch
Spacing   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
         $payload['appid'] = self::$instance->getConfig($type, '');
209 209
 
210 210
         if (self::$instance->getConfig('mode', Wechat::MODE_NORMAL) === Wechat::MODE_SERVICE) {
211
-            $payload['sub_appid'] = self::$instance->getConfig('sub_'.$type, '');
211
+            $payload['sub_appid'] = self::$instance->getConfig('sub_' . $type, '');
212 212
         }
213 213
 
214 214
         unset($payload['trade_type'], $payload['type']);
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 
243 243
         ksort($data);
244 244
 
245
-        $string = md5(self::getSignContent($data).'&key='.$key);
245
+        $string = md5(self::getSignContent($data) . '&key=' . $key);
246 246
 
247 247
         Log::debug('Wechat Generate Sign Before UPPER', [$data, $string]);
248 248
 
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
         $buff = '';
264 264
 
265 265
         foreach ($data as $k => $v) {
266
-            $buff .= ($k != 'sign' && $v != '' && !is_array($v)) ? $k.'='.$v.'&' : '';
266
+            $buff .= ($k != 'sign' && $v != '' && !is_array($v)) ? $k . '=' . $v . '&' : '';
267 267
         }
268 268
 
269 269
         Log::debug('Wechat Generate Sign Content Before Trim', [$data, $buff]);
@@ -309,8 +309,7 @@  discard block
 block discarded – undo
309 309
 
310 310
         $xml = '<xml>';
311 311
         foreach ($data as $key => $val) {
312
-            $xml .= is_numeric($val) ? '<'.$key.'>'.$val.'</'.$key.'>' :
313
-                                       '<'.$key.'><![CDATA['.$val.']]></'.$key.'>';
312
+            $xml .= is_numeric($val) ? '<' . $key . '>' . $val . '</' . $key . '>' : '<' . $key . '><![CDATA[' . $val . ']]></' . $key . '>';
314 313
         }
315 314
         $xml .= '</xml>';
316 315
 
@@ -381,7 +380,7 @@  discard block
 block discarded – undo
381 380
                 $type = 'appid';
382 381
                 break;
383 382
             default:
384
-                $type = $type.'_id';
383
+                $type = $type . '_id';
385 384
         }
386 385
 
387 386
         return $type;
@@ -417,7 +416,7 @@  discard block
 block discarded – undo
417 416
     {
418 417
         if (!isset($result['return_code']) || $result['return_code'] != 'SUCCESS' || $result['result_code'] != 'SUCCESS') {
419 418
             throw new GatewayException(
420
-                'Get Wechat API Error:'.($result['return_msg'] ?? $result['retmsg']).($result['err_code_des'] ?? ''),
419
+                'Get Wechat API Error:' . ($result['return_msg'] ?? $result['retmsg']) . ($result['err_code_des'] ?? ''),
421 420
                 $result,
422 421
                 20000
423 422
             );
Please login to merge, or discard this patch.