Passed
Push — master ( ab7eb6...522f6c )
by Songda
03:48 queued 01:30
created
src/Functions.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
         return file_get_contents($key);
49 49
     }
50 50
 
51
-    return "-----BEGIN RSA PRIVATE KEY-----\n".
52
-        wordwrap($key, 64, "\n", true).
51
+    return "-----BEGIN RSA PRIVATE KEY-----\n" .
52
+        wordwrap($key, 64, "\n", true) .
53 53
         "\n-----END RSA PRIVATE KEY-----";
54 54
 }
55 55
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         return $url;
158 158
     }
159 159
 
160
-    return Wechat::URL[$config['mode'] ?? Pay::MODE_NORMAL].$url;
160
+    return Wechat::URL[$config['mode'] ?? Pay::MODE_NORMAL] . $url;
161 161
 }
162 162
 
163 163
 /**
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 
177 177
 function get_wechat_type_key(array $params): string
178 178
 {
179
-    $key = ($params['_type'] ?? 'mp').'_app_id';
179
+    $key = ($params['_type'] ?? 'mp') . '_app_id';
180 180
 
181 181
     if ('app_app_id' === $key) {
182 182
         $key = 'app_id';
@@ -219,10 +219,10 @@  discard block
 block discarded – undo
219 219
     $buff = '';
220 220
 
221 221
     foreach ($payload as $k => $v) {
222
-        $buff .= ('sign' != $k && '' != $v && !is_array($v)) ? $k.'='.$v.'&' : '';
222
+        $buff .= ('sign' != $k && '' != $v && !is_array($v)) ? $k . '=' . $v . '&' : '';
223 223
     }
224 224
 
225
-    $sign = md5($buff.'key='.$key);
225
+    $sign = md5($buff . 'key=' . $key);
226 226
 
227 227
     return $upper ? strtoupper($sign) : $sign;
228 228
 }
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
  * @throws InvalidSignException
236 236
  * @throws ServiceNotFoundException
237 237
  */
238
-function verify_wechat_sign(ResponseInterface|ServerRequestInterface $message, array $params): void
238
+function verify_wechat_sign(ResponseInterface | ServerRequestInterface $message, array $params): void
239 239
 {
240 240
     if ($message instanceof ServerRequestInterface && 'localhost' === $message->getUri()->getHost()) {
241 241
         return;
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
     $sign = $message->getHeaderLine('Wechatpay-Signature');
248 248
     $body = (string) $message->getBody();
249 249
 
250
-    $content = $timestamp."\n".$random."\n".$body."\n";
250
+    $content = $timestamp . "\n" . $random . "\n" . $body . "\n";
251 251
     $public = get_provider_config('wechat', $params)['wechat_public_cert_path'][$wechatSerial] ?? null;
252 252
 
253 253
     if (empty($sign)) {
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
     }
333 333
 
334 334
     Pay::get(ConfigInterface::class)->set(
335
-        'wechat.'.get_tenant($params).'.wechat_public_cert_path',
335
+        'wechat.' . get_tenant($params) . '.wechat_public_cert_path',
336 336
         ((array) ($wechatConfig['wechat_public_cert_path'] ?? [])) + ($certs ?? []),
337 337
     );
338 338
 
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
     }
364 364
 
365 365
     foreach ($config['wechat_public_cert_path'] as $serialNo => $cert) {
366
-        file_put_contents($path.'/'.$serialNo.'.crt', $cert);
366
+        file_put_contents($path . '/' . $serialNo . '.crt', $cert);
367 367
     }
368 368
 }
369 369
 
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
 /**
396 396
  * @throws DecryptException
397 397
  */
398
-function decrypt_wechat_resource_aes_256_gcm(string $ciphertext, string $secret, string $nonce, string $associatedData): array|string
398
+function decrypt_wechat_resource_aes_256_gcm(string $ciphertext, string $secret, string $nonce, string $associatedData): array | string
399 399
 {
400 400
     $decrypted = openssl_decrypt(
401 401
         substr($ciphertext, 0, -Wechat::AUTH_TAG_LENGTH_BYTE),
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
     $publicKey = $config['wechat_public_cert_path'][$serialNo] ?? null;
457 457
 
458 458
     if (empty($publicKey)) {
459
-        throw new InvalidParamsException(Exception::PARAMS_WECHAT_SERIAL_NOT_FOUND, '参数异常: 微信公钥序列号未找到 - '.$serialNo);
459
+        throw new InvalidParamsException(Exception::PARAMS_WECHAT_SERIAL_NOT_FOUND, '参数异常: 微信公钥序列号未找到 - ' . $serialNo);
460 460
     }
461 461
 
462 462
     return $publicKey;
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
         throw new InvalidConfigException(Exception::CONFIG_WECHAT_INVALID, '配置异常: 缺少微信配置 -- [mini_app_key_virtual_pay]');
472 472
     }
473 473
 
474
-    return hash_hmac('sha256', $url.'&'.$payload, $config['mini_app_key_virtual_pay']);
474
+    return hash_hmac('sha256', $url . '&' . $payload, $config['mini_app_key_virtual_pay']);
475 475
 }
476 476
 
477 477
 function get_wechat_miniprogram_user_sign(string $sessionKey, string $payload): string
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
         return $url;
533 533
     }
534 534
 
535
-    return Unipay::URL[$config['mode'] ?? Pay::MODE_NORMAL].$url;
535
+    return Unipay::URL[$config['mode'] ?? Pay::MODE_NORMAL] . $url;
536 536
 }
537 537
 
538 538
 /**
@@ -565,10 +565,10 @@  discard block
 block discarded – undo
565 565
     $buff = '';
566 566
 
567 567
     foreach ($payload as $k => $v) {
568
-        $buff .= ('sign' != $k && '' != $v && !is_array($v)) ? $k.'='.$v.'&' : '';
568
+        $buff .= ('sign' != $k && '' != $v && !is_array($v)) ? $k . '=' . $v . '&' : '';
569 569
     }
570 570
 
571
-    return strtoupper(md5($buff.'key='.$key));
571
+    return strtoupper(md5($buff . 'key=' . $key));
572 572
 }
573 573
 
574 574
 /**
@@ -647,5 +647,5 @@  discard block
 block discarded – undo
647 647
         return $url;
648 648
     }
649 649
 
650
-    return Douyin::URL[$config['mode'] ?? Pay::MODE_NORMAL].$url;
650
+    return Douyin::URL[$config['mode'] ?? Pay::MODE_NORMAL] . $url;
651 651
 }
Please login to merge, or discard this patch.
src/Plugin/Wechat/V3/Marketing/MchTransfer/QueryByWxPlugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
 
45 45
         $rocket->setPayload([
46 46
             '_method' => 'GET',
47
-            '_url' => 'v3/fund-app/mch-transfer/transfer-bills/transfer-bill-no/'.$transferBillNo,
47
+            '_url' => 'v3/fund-app/mch-transfer/transfer-bills/transfer-bill-no/' . $transferBillNo,
48 48
         ]);
49 49
 
50 50
         Logger::info('[Wechat][Marketing][MchTransfer][QueryByWxPlugin] 插件装载完毕', ['rocket' => $rocket]);
Please login to merge, or discard this patch.
src/Plugin/Wechat/V3/Marketing/MchTransfer/QueryPlugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
 
45 45
         $rocket->setPayload([
46 46
             '_method' => 'GET',
47
-            '_url' => 'v3/fund-app/mch-transfer/transfer-bills/out-bill-no/'.$outBillNo,
47
+            '_url' => 'v3/fund-app/mch-transfer/transfer-bills/out-bill-no/' . $outBillNo,
48 48
         ]);
49 49
 
50 50
         Logger::info('[Wechat][Marketing][MchTransfer][QueryPlugin] 插件装载完毕', ['rocket' => $rocket]);
Please login to merge, or discard this patch.
src/Plugin/Wechat/V3/Marketing/MchTransfer/CancelPlugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
 
45 45
         $rocket->setPayload([
46 46
             '_method' => 'POST',
47
-            '_url' => 'v3/fund-app/mch-transfer/transfer-bills/out-bill-no/'.$outBillNo.'/cancel',
47
+            '_url' => 'v3/fund-app/mch-transfer/transfer-bills/out-bill-no/' . $outBillNo . '/cancel',
48 48
         ]);
49 49
 
50 50
         Logger::info('[Wechat][Marketing][MchTransfer][CancelPlugin] 插件装载完毕', ['rocket' => $rocket]);
Please login to merge, or discard this patch.
src/Shortcut/Wechat/TransferShortcut.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
      */
33 33
     public function getPlugins(array $params): array
34 34
     {
35
-        $method = Str::camel($params['_action'] ?? 'default').'Plugins';
35
+        $method = Str::camel($params['_action'] ?? 'default') . 'Plugins';
36 36
 
37 37
         if (method_exists($this, $method)) {
38 38
             return $this->{$method}();
Please login to merge, or discard this patch.