Passed
Pull Request — master (#753)
by Songda
04:14 queued 02:24
created
src/Plugin/Wechat/Pay/Common/PrepayPlugin.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
                 'sub_mchid' => $payload->get('sub_mchid', $config['sub_mch_id'] ?? null),
57 57
             ];
58 58
 
59
-            $subAppId = $payload->get('sub_appid', $config['sub_'.$configKey] ?? null);
59
+            $subAppId = $payload->get('sub_appid', $config['sub_' . $configKey] ?? null);
60 60
 
61 61
             if (!empty($subAppId)) {
62 62
                 $result['sub_appid'] = $subAppId;
Please login to merge, or discard this patch.
src/Plugin/Wechat/GeneralPlugin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 
63 63
         $url = Pay::MODE_SERVICE === (get_wechat_config($params)['mode'] ?? null) ? $this->getPartnerUri($rocket) : $this->getUri($rocket);
64 64
 
65
-        return 0 === strpos($url, 'http') ? $url : (get_wechat_base_uri($params).$url);
65
+        return 0 === strpos($url, 'http') ? $url : (get_wechat_base_uri($params) . $url);
66 66
     }
67 67
 
68 68
     protected function getHeaders(): array
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 
77 77
     protected function getConfigKey(array $params): string
78 78
     {
79
-        $key = ($params['_type'] ?? 'mp').'_app_id';
79
+        $key = ($params['_type'] ?? 'mp') . '_app_id';
80 80
 
81 81
         if ('app_app_id' === $key) {
82 82
             $key = 'app_id';
Please login to merge, or discard this patch.
src/Plugin/Wechat/RadarSignPlugin.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
             throw new InvalidConfigException(Exception::WECHAT_CONFIG_ERROR, 'Missing Wechat Config -- [mch_secret_key_v2]');
92 92
         }
93 93
 
94
-        $string = md5($this->v2PayloadToString($payload).'&key='.$secret);
94
+        $string = md5($this->v2PayloadToString($payload) . '&key=' . $secret);
95 95
 
96 96
         return strtoupper($string);
97 97
     }
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         $buff = '';
104 104
 
105 105
         foreach ($payload as $k => $v) {
106
-            $buff .= ('sign' != $k && '' != $v && !is_array($v)) ? $k.'='.$v.'&' : '';
106
+            $buff .= ('sign' != $k && '' != $v && !is_array($v)) ? $k . '=' . $v . '&' : '';
107 107
         }
108 108
 
109 109
         return trim($buff, '&');
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
             get_wechat_sign($params, $contents),
166 166
         );
167 167
 
168
-        return 'WECHATPAY2-SHA256-RSA2048 '.$auth;
168
+        return 'WECHATPAY2-SHA256-RSA2048 ' . $auth;
169 169
     }
170 170
 
171 171
     /**
@@ -181,11 +181,11 @@  discard block
 block discarded – undo
181 181
 
182 182
         $uri = $request->getUri();
183 183
 
184
-        return $request->getMethod()."\n".
185
-            $uri->getPath().(empty($uri->getQuery()) ? '' : '?'.$uri->getQuery())."\n".
186
-            $timestamp."\n".
187
-            $random."\n".
188
-            $this->v3PayloadToString($rocket->getPayload())."\n";
184
+        return $request->getMethod() . "\n" .
185
+            $uri->getPath() . (empty($uri->getQuery()) ? '' : '?' . $uri->getQuery()) . "\n" .
186
+            $timestamp . "\n" .
187
+            $random . "\n" .
188
+            $this->v3PayloadToString($rocket->getPayload()) . "\n";
189 189
     }
190 190
 
191 191
     protected function v3PayloadToString(?Collection $payload): string
Please login to merge, or discard this patch.