Passed
Pull Request — master (#900)
by Songda
02:06
created
src/Provider/Alipay.php 1 patch
Spacing   +9 added lines, -10 removed lines patch added patch discarded remove patch
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
      * @throws InvalidParamsException
48 48
      * @throws ServiceNotFoundException
49 49
      */
50
-    public function __call(string $shortcut, array $params): null|Collection|MessageInterface
50
+    public function __call(string $shortcut, array $params): null | Collection | MessageInterface
51 51
     {
52
-        $plugin = '\\Yansongda\\Pay\\Shortcut\\Alipay\\'.Str::studly($shortcut).'Shortcut';
52
+        $plugin = '\\Yansongda\\Pay\\Shortcut\\Alipay\\' . Str::studly($shortcut) . 'Shortcut';
53 53
 
54 54
         return $this->call($plugin, ...$params);
55 55
     }
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
      * @throws InvalidParamsException
60 60
      * @throws ServiceNotFoundException
61 61
      */
62
-    public function query(array $order): array|Collection
62
+    public function query(array $order): array | Collection
63 63
     {
64 64
         Event::dispatch(new Event\MethodCalled('alipay', __METHOD__, $order, null));
65 65
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      * @throws InvalidParamsException
72 72
      * @throws ServiceNotFoundException
73 73
      */
74
-    public function cancel(array $order): null|array|Collection
74
+    public function cancel(array $order): null | array | Collection
75 75
     {
76 76
         Event::dispatch(new Event\MethodCalled('alipay', __METHOD__, $order, null));
77 77
 
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      * @throws InvalidParamsException
84 84
      * @throws ServiceNotFoundException
85 85
      */
86
-    public function close(array|string $order): null|array|Collection
86
+    public function close(array | string $order): null | array | Collection
87 87
     {
88 88
         $order = is_array($order) ? $order : ['out_trade_no' => $order];
89 89
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
      * @throws InvalidParamsException
98 98
      * @throws ServiceNotFoundException
99 99
      */
100
-    public function refund(array $order): array|Collection
100
+    public function refund(array $order): array | Collection
101 101
     {
102 102
         Event::dispatch(new Event\MethodCalled('alipay', __METHOD__, $order, null));
103 103
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
      * @throws ContainerException
109 109
      * @throws InvalidParamsException
110 110
      */
111
-    public function callback(null|array|ServerRequestInterface $contents = null, ?array $params = null): Collection
111
+    public function callback(null | array | ServerRequestInterface $contents = null, ?array $params = null): Collection
112 112
     {
113 113
         $request = $this->getCallbackParams($contents);
114 114
 
@@ -134,15 +134,14 @@  discard block
 block discarded – undo
134 134
         );
135 135
     }
136 136
 
137
-    protected function getCallbackParams(array|ServerRequestInterface $contents = null): Collection
137
+    protected function getCallbackParams(array | ServerRequestInterface $contents = null): Collection
138 138
     {
139 139
         if (is_array($contents)) {
140 140
             return Collection::wrap($contents);
141 141
         }
142 142
 
143 143
         if ($contents instanceof ServerRequestInterface) {
144
-            return Collection::wrap('GET' === $contents->getMethod() ? $contents->getQueryParams() :
145
-                $contents->getParsedBody());
144
+            return Collection::wrap('GET' === $contents->getMethod() ? $contents->getQueryParams() : $contents->getParsedBody());
146 145
         }
147 146
 
148 147
         $request = ServerRequest::fromGlobals();
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
@@ -51,10 +51,10 @@  discard block
 block discarded – undo
51 51
      * @throws InvalidParamsException
52 52
      * @throws ServiceNotFoundException
53 53
      */
54
-    public function __call(string $shortcut, array $params): null|Collection|MessageInterface
54
+    public function __call(string $shortcut, array $params): null | Collection | MessageInterface
55 55
     {
56
-        $plugin = '\\Yansongda\\Pay\\Plugin\\Wechat\\Shortcut\\'.
57
-            Str::studly($shortcut).'Shortcut';
56
+        $plugin = '\\Yansongda\\Pay\\Plugin\\Wechat\\Shortcut\\' .
57
+            Str::studly($shortcut) . 'Shortcut';
58 58
 
59 59
         return $this->call($plugin, ...$params);
60 60
     }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      * @throws InvalidParamsException
65 65
      * @throws ServiceNotFoundException
66 66
      */
67
-    public function query(array $order): array|Collection
67
+    public function query(array $order): array | Collection
68 68
     {
69 69
         Event::dispatch(new Event\MethodCalled('wechat', __METHOD__, $order, null));
70 70
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     /**
75 75
      * @throws InvalidParamsException
76 76
      */
77
-    public function cancel(array $order): null|array|Collection
77
+    public function cancel(array $order): null | array | Collection
78 78
     {
79 79
         throw new InvalidParamsException(Exception::METHOD_NOT_SUPPORTED, 'Wechat does not support cancel api');
80 80
     }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      * @throws InvalidParamsException
85 85
      * @throws ServiceNotFoundException
86 86
      */
87
-    public function close(array|string $order): null|array|Collection
87
+    public function close(array | string $order): null | array | Collection
88 88
     {
89 89
         $order = is_array($order) ? $order : ['out_trade_no' => $order];
90 90
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      * @throws InvalidParamsException
101 101
      * @throws ServiceNotFoundException
102 102
      */
103
-    public function refund(array $order): array|Collection
103
+    public function refund(array $order): array | Collection
104 104
     {
105 105
         Event::dispatch(new Event\MethodCalled('wechat', __METHOD__, $order, null));
106 106
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      * @throws ContainerException
112 112
      * @throws InvalidParamsException
113 113
      */
114
-    public function callback(null|array|ServerRequestInterface $contents = null, ?array $params = null): Collection
114
+    public function callback(null | array | ServerRequestInterface $contents = null, ?array $params = null): Collection
115 115
     {
116 116
         $request = $this->getCallbackParams($contents);
117 117
 
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         );
143 143
     }
144 144
 
145
-    protected function getCallbackParams(null|array|ServerRequestInterface $contents = null): ServerRequestInterface
145
+    protected function getCallbackParams(null | array | ServerRequestInterface $contents = null): ServerRequestInterface
146 146
     {
147 147
         if (is_array($contents) && isset($contents['body'], $contents['headers'])) {
148 148
             return new ServerRequest('POST', 'http://localhost', $contents['headers'], $contents['body']);
Please login to merge, or discard this patch.
src/Provider/Unipay.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -39,10 +39,10 @@  discard block
 block discarded – undo
39 39
      * @throws InvalidParamsException
40 40
      * @throws ServiceNotFoundException
41 41
      */
42
-    public function __call(string $shortcut, array $params): null|Collection|MessageInterface
42
+    public function __call(string $shortcut, array $params): null | Collection | MessageInterface
43 43
     {
44
-        $plugin = '\\Yansongda\\Pay\\Plugin\\Unipay\\Shortcut\\'.
45
-            Str::studly($shortcut).'Shortcut';
44
+        $plugin = '\\Yansongda\\Pay\\Plugin\\Unipay\\Shortcut\\' .
45
+            Str::studly($shortcut) . 'Shortcut';
46 46
 
47 47
         return $this->call($plugin, ...$params);
48 48
     }
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
      * @throws InvalidParamsException
53 53
      * @throws ServiceNotFoundException
54 54
      */
55
-    public function query(array $order): array|Collection
55
+    public function query(array $order): array | Collection
56 56
     {
57 57
         Event::dispatch(new Event\MethodCalled('unipay', __METHOD__, $order, null));
58 58
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      * @throws InvalidParamsException
65 65
      * @throws ServiceNotFoundException
66 66
      */
67
-    public function cancel(array $order): null|array|Collection
67
+    public function cancel(array $order): null | array | Collection
68 68
     {
69 69
         Event::dispatch(new Event\MethodCalled('unipay', __METHOD__, $order, null));
70 70
 
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     /**
75 75
      * @throws InvalidParamsException
76 76
      */
77
-    public function close(array|string $order): null|array|Collection
77
+    public function close(array | string $order): null | array | Collection
78 78
     {
79 79
         throw new InvalidParamsException(Exception::METHOD_NOT_SUPPORTED, 'Unipay does not support close api');
80 80
     }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
      * @throws InvalidParamsException
85 85
      * @throws ServiceNotFoundException
86 86
      */
87
-    public function refund(array $order): array|Collection
87
+    public function refund(array $order): array | Collection
88 88
     {
89 89
         Event::dispatch(new Event\MethodCalled('unipay', __METHOD__, $order, null));
90 90
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      * @throws ContainerException
96 96
      * @throws InvalidParamsException
97 97
      */
98
-    public function callback(null|array|ServerRequestInterface $contents = null, ?array $params = null): Collection
98
+    public function callback(null | array | ServerRequestInterface $contents = null, ?array $params = null): Collection
99 99
     {
100 100
         $request = $this->getCallbackParams($contents);
101 101
 
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         );
123 123
     }
124 124
 
125
-    protected function getCallbackParams(null|array|ServerRequestInterface $contents = null): Collection
125
+    protected function getCallbackParams(null | array | ServerRequestInterface $contents = null): Collection
126 126
     {
127 127
         if (is_array($contents)) {
128 128
             return Collection::wrap($contents);
Please login to merge, or discard this patch.
src/Contract/ProviderInterface.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,17 +19,17 @@
 block discarded – undo
19 19
      * @throws InvalidParamsException
20 20
      * @throws ServiceNotFoundException
21 21
      */
22
-    public function pay(array $plugins, array $params): null|array|Collection|MessageInterface;
22
+    public function pay(array $plugins, array $params): null | array | Collection | MessageInterface;
23 23
 
24
-    public function query(array $order): array|Collection;
24
+    public function query(array $order): array | Collection;
25 25
 
26
-    public function cancel(array $order): null|array|Collection;
26
+    public function cancel(array $order): null | array | Collection;
27 27
 
28
-    public function close(array|string $order): null|array|Collection;
28
+    public function close(array | string $order): null | array | Collection;
29 29
 
30
-    public function refund(array $order): array|Collection;
30
+    public function refund(array $order): array | Collection;
31 31
 
32
-    public function callback(null|array|ServerRequestInterface $contents = null, ?array $params = null): Collection;
32
+    public function callback(null | array | ServerRequestInterface $contents = null, ?array $params = null): Collection;
33 33
 
34 34
     public function success(): ResponseInterface;
35 35
 }
Please login to merge, or discard this patch.