Completed
Push — master ( d40843...56c44b )
by Songda
02:04 queued 11s
created
src/Plugin/Alipay/PreparePlugin.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             $detail = $this->formatCert(openssl_x509_parse($cert));
90 90
 
91 91
             if ('sha1WithRSAEncryption' == $detail['signatureTypeLN'] || 'sha256WithRSAEncryption' == $detail['signatureTypeLN']) {
92
-                $sn .= $this->getCertSn($detail['issuer'], $detail['serialNumber']).'_';
92
+                $sn .= $this->getCertSn($detail['issuer'], $detail['serialNumber']) . '_';
93 93
             }
94 94
         }
95 95
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
     protected function getCertSn(array $issuer, string $serialNumber): string
100 100
     {
101 101
         return md5(
102
-            $this->array2string(array_reverse($issuer)).$serialNumber
102
+            $this->array2string(array_reverse($issuer)) . $serialNumber
103 103
         );
104 104
     }
105 105
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
         $string = [];
109 109
 
110 110
         foreach ($array as $key => $value) {
111
-            $string[] = $key.'='.$value;
111
+            $string[] = $key . '=' . $value;
112 112
         }
113 113
 
114 114
         return implode(',', $string);
Please login to merge, or discard this patch.
src/Plugin/Alipay/Shortcut/WebShortcut.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,15 +37,14 @@  discard block
 block discarded – undo
37 37
                 $radar = $rocket->getRadar();
38 38
 
39 39
                 $response = 'GET' === $radar->getMethod() ?
40
-                    $this->buildRedirect($radar->getUri()->__toString(), $rocket->getPayload()) :
41
-                    $this->buildHtml($radar->getUri()->__toString(), $rocket->getPayload());
40
+                    $this->buildRedirect($radar->getUri()->__toString(), $rocket->getPayload()) : $this->buildHtml($radar->getUri()->__toString(), $rocket->getPayload());
42 41
 
43 42
                 return $rocket->setDestination($response);
44 43
             }
45 44
 
46 45
             protected function buildRedirect(string $endpoint, Collection $payload): Response
47 46
             {
48
-                $url = $endpoint.'?'.Arr::query($payload->all());
47
+                $url = $endpoint . '?' . Arr::query($payload->all());
49 48
 
50 49
                 $content = sprintf('<!DOCTYPE html>
51 50
                     <html lang="en">
@@ -66,10 +65,10 @@  discard block
 block discarded – undo
66 65
 
67 66
             protected function buildHtml(string $endpoint, Collection $payload): Response
68 67
             {
69
-                $sHtml = "<form id='alipay_submit' name='alipay_submit' action='".$endpoint."?charset=utf-8' method='POST'>";
68
+                $sHtml = "<form id='alipay_submit' name='alipay_submit' action='" . $endpoint . "?charset=utf-8' method='POST'>";
70 69
                 foreach ($payload->all() as $key => $val) {
71 70
                     $val = str_replace("'", '&apos;', $val);
72
-                    $sHtml .= "<input type='hidden' name='".$key."' value='".$val."'/>";
71
+                    $sHtml .= "<input type='hidden' name='" . $key . "' value='" . $val . "'/>";
73 72
                 }
74 73
                 $sHtml .= "<input type='submit' value='ok' style='display:none;'></form>";
75 74
                 $sHtml .= "<script>document.forms['alipay_submit'].submit();</script>";
Please login to merge, or discard this patch.
src/Plugin/Alipay/SignPlugin.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
             throw new InvalidConfigException(InvalidConfigException::ALIPAY_CONFIG_ERROR, 'Missing Alipay Config -- [app_secret_cert]');
52 52
         }
53 53
 
54
-        $privateKey = "-----BEGIN RSA PRIVATE KEY-----\n".
55
-            wordwrap($privateKey, 64, "\n", true).
54
+        $privateKey = "-----BEGIN RSA PRIVATE KEY-----\n" .
55
+            wordwrap($privateKey, 64, "\n", true) .
56 56
             "\n-----END RSA PRIVATE KEY-----";
57 57
 
58 58
         if (Str::endsWith($privateKey, '.pem')) {
59 59
             $privateKey = openssl_pkey_get_private(
60
-                Str::startsWith($privateKey, 'file://') ? $privateKey : 'file://'.$privateKey
60
+                Str::startsWith($privateKey, 'file://') ? $privateKey : 'file://' . $privateKey
61 61
             );
62 62
         }
63 63
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         $result = '';
70 70
 
71 71
         foreach ($payload->sortKeys()->all() as $key => $value) {
72
-            $result .= $key.'='.$value.'&';
72
+            $result .= $key . '=' . $value . '&';
73 73
         }
74 74
 
75 75
         return substr($result, 0, -1);
Please login to merge, or discard this patch.
src/Plugin/Alipay/FilterPlugin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,11 +16,11 @@
 block discarded – undo
16 16
      */
17 17
     public function assembly(Rocket $rocket, Closure $next): Rocket
18 18
     {
19
-        $payload = $rocket->getPayload()->filter(function ($v, $k) {
19
+        $payload = $rocket->getPayload()->filter(function($v, $k) {
20 20
             return '' !== $v && !is_null($v) && 'sign' != $k;
21 21
         });
22 22
 
23
-        $contents = array_filter($payload->get('biz_content'), function ($v, $k) {
23
+        $contents = array_filter($payload->get('biz_content'), function($v, $k) {
24 24
             return !Str::startsWith($k, '_');
25 25
         }, ARRAY_FILTER_USE_BOTH);
26 26
 
Please login to merge, or discard this patch.