Passed
Push — master ( a1bcd2...a1b58e )
by Songda
02:08
created
src/Functions.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
 
62 62
         if (Str::endsWith($key, ['.crt', '.pem'])) {
63 63
             return openssl_pkey_get_private(
64
-                Str::startsWith($key, 'file://') ? $key : 'file://'.$key
64
+                Str::startsWith($key, 'file://') ? $key : 'file://' . $key
65 65
             );
66 66
         }
67 67
 
68
-        return "-----BEGIN RSA PRIVATE KEY-----\n".
69
-            wordwrap($key, 64, "\n", true).
68
+        return "-----BEGIN RSA PRIVATE KEY-----\n" .
69
+            wordwrap($key, 64, "\n", true) .
70 70
             "\n-----END RSA PRIVATE KEY-----";
71 71
     }
72 72
 }
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
             get_wechat_sign($params, $contents),
163 163
         );
164 164
 
165
-        return 'WECHATPAY2-SHA256-RSA2048 '.$auth;
165
+        return 'WECHATPAY2-SHA256-RSA2048 ' . $auth;
166 166
     }
167 167
 }
168 168
 
@@ -216,8 +216,8 @@  discard block
 block discarded – undo
216 216
         $sign = $message->getHeaderLine('Wechatpay-Signature');
217 217
         $body = $message->getBody()->getContents();
218 218
 
219
-        $content = $timestamp."\n".$random."\n".$body."\n";
220
-        $public = get_wechat_config($params)->get('wechat_public_cert_path.'.$wechatSerial);
219
+        $content = $timestamp . "\n" . $random . "\n" . $body . "\n";
220
+        $public = get_wechat_config($params)->get('wechat_public_cert_path.' . $wechatSerial);
221 221
 
222 222
         if (empty($sign)) {
223 223
             throw new InvalidResponseException(Exception::INVALID_RESPONSE_SIGN, '', ['headers' => $message->getHeaders(), 'body' => $body]);
@@ -252,10 +252,10 @@  discard block
 block discarded – undo
252 252
     {
253 253
         $config = get_wechat_config($params);
254 254
 
255
-        $publicKey = $config->get('wechat_public_cert_path.'.$serialNo);
255
+        $publicKey = $config->get('wechat_public_cert_path.' . $serialNo);
256 256
 
257 257
         if (empty($publicKey)) {
258
-            throw new InvalidParamsException(Exception::WECHAT_SERIAL_NO_NOT_FOUND, 'Wechat serial no not found: '.$serialNo);
258
+            throw new InvalidParamsException(Exception::WECHAT_SERIAL_NO_NOT_FOUND, 'Wechat serial no not found: ' . $serialNo);
259 259
         }
260 260
 
261 261
         if (openssl_public_encrypt($contents, $encrypted, get_public_or_private_cert($publicKey, true), OPENSSL_PKCS1_OAEP_PADDING)) {
Please login to merge, or discard this patch.
src/Plugin/Wechat/SignPlugin.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,11 +63,11 @@
 block discarded – undo
63 63
 
64 64
         $uri = $request->getUri();
65 65
 
66
-        return $request->getMethod()."\n".
67
-            $uri->getPath().(empty($uri->getQuery()) ? '' : '?'.$uri->getQuery())."\n".
68
-            $timestamp."\n".
69
-            $random."\n".
70
-            $this->payloadToString($rocket->getPayload())."\n";
66
+        return $request->getMethod() . "\n" .
67
+            $uri->getPath() . (empty($uri->getQuery()) ? '' : '?' . $uri->getQuery()) . "\n" .
68
+            $timestamp . "\n" .
69
+            $random . "\n" .
70
+            $this->payloadToString($rocket->getPayload()) . "\n";
71 71
     }
72 72
 
73 73
     protected function payloadToString(?Collection $payload): string
Please login to merge, or discard this patch.