Passed
Pull Request — master (#1099)
by Songda
02:23
created
src/Plugin/Wechat/V3/Pay/Combine/MiniInvokePlugin.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
     {
71 71
         $invokeConfig = new Config([
72 72
             'appId' => $this->getAppId($payload, $config),
73
-            'timeStamp' => time().'',
73
+            'timeStamp' => time() . '',
74 74
             'nonceStr' => Str::random(32),
75
-            'package' => 'prepay_id='.$prepayId,
75
+            'package' => 'prepay_id=' . $prepayId,
76 76
             'signType' => 'RSA',
77 77
         ]);
78 78
 
@@ -86,10 +86,10 @@  discard block
 block discarded – undo
86 86
      */
87 87
     protected function getSign(Collection $invokeConfig, array $config): string
88 88
     {
89
-        $contents = $invokeConfig->get('appId', '')."\n"
90
-            .$invokeConfig->get('timeStamp', '')."\n"
91
-            .$invokeConfig->get('nonceStr', '')."\n"
92
-            .$invokeConfig->get('package', '')."\n";
89
+        $contents = $invokeConfig->get('appId', '') . "\n"
90
+            .$invokeConfig->get('timeStamp', '') . "\n"
91
+            .$invokeConfig->get('nonceStr', '') . "\n"
92
+            .$invokeConfig->get('package', '') . "\n";
93 93
 
94 94
         return get_wechat_sign($config, $contents);
95 95
     }
Please login to merge, or discard this patch.
src/Plugin/Wechat/V3/Pay/Combine/AppInvokePlugin.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
             'prepayid' => $prepayId,
75 75
             'package' => 'Sign=WXPay',
76 76
             'noncestr' => Str::random(32),
77
-            'timestamp' => time().'',
77
+            'timestamp' => time() . '',
78 78
         ]);
79 79
 
80 80
         $invokeConfig->set('sign', $this->getSign($invokeConfig, $config));
@@ -87,10 +87,10 @@  discard block
 block discarded – undo
87 87
      */
88 88
     protected function getSign(Collection $invokeConfig, array $config): string
89 89
     {
90
-        $contents = $invokeConfig->get('appid', '')."\n"
91
-            .$invokeConfig->get('timestamp', '')."\n"
92
-            .$invokeConfig->get('noncestr', '')."\n"
93
-            .$invokeConfig->get('prepayid', '')."\n";
90
+        $contents = $invokeConfig->get('appid', '') . "\n"
91
+            .$invokeConfig->get('timestamp', '') . "\n"
92
+            .$invokeConfig->get('noncestr', '') . "\n"
93
+            .$invokeConfig->get('prepayid', '') . "\n";
94 94
 
95 95
         return get_wechat_sign($config, $contents);
96 96
     }
Please login to merge, or discard this patch.
src/Shortcut/Wechat/CancelShortcut.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.
src/Provider/Wechat.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
      * @throws InvalidParamsException
57 57
      * @throws ServiceNotFoundException
58 58
      */
59
-    public function __call(string $shortcut, array $params): null|Collection|MessageInterface|Rocket
59
+    public function __call(string $shortcut, array $params): null | Collection | MessageInterface | Rocket
60 60
     {
61
-        $plugin = '\Yansongda\Pay\Shortcut\Wechat\\'.Str::studly($shortcut).'Shortcut';
61
+        $plugin = '\Yansongda\Pay\Shortcut\Wechat\\' . Str::studly($shortcut) . 'Shortcut';
62 62
 
63 63
         return Artful::shortcut($plugin, ...$params);
64 64
     }
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      * @throws ContainerException
68 68
      * @throws InvalidParamsException
69 69
      */
70
-    public function pay(array $plugins, array $params): null|Collection|MessageInterface|Rocket
70
+    public function pay(array $plugins, array $params): null | Collection | MessageInterface | Rocket
71 71
     {
72 72
         return Artful::artful($plugins, $params);
73 73
     }
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      * @throws InvalidParamsException
78 78
      * @throws ServiceNotFoundException
79 79
      */
80
-    public function query(array $order): Collection|Rocket
80
+    public function query(array $order): Collection | Rocket
81 81
     {
82 82
         Event::dispatch(new MethodCalled('wechat', __METHOD__, $order, null));
83 83
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
     /**
88 88
      * @throws InvalidParamsException
89 89
      */
90
-    public function cancel(array $order): Collection|Rocket
90
+    public function cancel(array $order): Collection | Rocket
91 91
     {
92 92
         Event::dispatch(new MethodCalled('wechat', __METHOD__, $order, null));
93 93
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      * @throws InvalidParamsException
100 100
      * @throws ServiceNotFoundException
101 101
      */
102
-    public function close(array $order): Collection|Rocket
102
+    public function close(array $order): Collection | Rocket
103 103
     {
104 104
         Event::dispatch(new MethodCalled('wechat', __METHOD__, $order, null));
105 105
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      * @throws InvalidParamsException
114 114
      * @throws ServiceNotFoundException
115 115
      */
116
-    public function refund(array $order): Collection|Rocket
116
+    public function refund(array $order): Collection | Rocket
117 117
     {
118 118
         Event::dispatch(new MethodCalled('wechat', __METHOD__, $order, null));
119 119
 
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
      * @throws ContainerException
125 125
      * @throws InvalidParamsException
126 126
      */
127
-    public function callback(null|array|ServerRequestInterface $contents = null, ?array $params = null): Collection|Rocket
127
+    public function callback(null | array | ServerRequestInterface $contents = null, ?array $params = null): Collection | Rocket
128 128
     {
129 129
         $request = $this->getCallbackParams($contents);
130 130
 
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
         );
155 155
     }
156 156
 
157
-    protected function getCallbackParams(null|array|ServerRequestInterface $contents = null): ServerRequestInterface
157
+    protected function getCallbackParams(null | array | ServerRequestInterface $contents = null): ServerRequestInterface
158 158
     {
159 159
         if (is_array($contents) && isset($contents['body'], $contents['headers'])) {
160 160
             return new ServerRequest('POST', 'http://localhost', $contents['headers'], $contents['body']);
Please login to merge, or discard this patch.
src/Shortcut/Wechat/QueryShortcut.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
             return $this->combinePlugins();
43 43
         }
44 44
 
45
-        $method = Str::camel($params['_action'] ?? 'default').'Plugins';
45
+        $method = Str::camel($params['_action'] ?? 'default') . 'Plugins';
46 46
 
47 47
         if (method_exists($this, $method)) {
48 48
             return $this->{$method}($params);
Please login to merge, or discard this patch.