Passed
Push — master ( ad6a8a...f9ed5d )
by Songda
06:06 queued 03:11
created
src/Contract/ProviderInterface.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -12,17 +12,17 @@
 block discarded – undo
12 12
 
13 13
 interface ProviderInterface
14 14
 {
15
-    public function pay(array $plugins, array $params): Collection|MessageInterface|Rocket|null;
15
+    public function pay(array $plugins, array $params): Collection | MessageInterface | Rocket | null;
16 16
 
17
-    public function query(array $order): Collection|Rocket;
17
+    public function query(array $order): Collection | Rocket;
18 18
 
19
-    public function cancel(array $order): Collection|Rocket;
19
+    public function cancel(array $order): Collection | Rocket;
20 20
 
21
-    public function close(array $order): Collection|Rocket;
21
+    public function close(array $order): Collection | Rocket;
22 22
 
23
-    public function refund(array $order): Collection|Rocket;
23
+    public function refund(array $order): Collection | Rocket;
24 24
 
25
-    public function callback(array|ServerRequestInterface|null $contents = null, ?array $params = null): Collection|Rocket;
25
+    public function callback(array | ServerRequestInterface | null $contents = null, ?array $params = null): Collection | Rocket;
26 26
 
27 27
     public function success(): ResponseInterface;
28 28
 }
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
@@ -55,9 +55,9 @@  discard block
 block discarded – undo
55 55
      * @throws InvalidParamsException
56 56
      * @throws ServiceNotFoundException
57 57
      */
58
-    public function __call(string $shortcut, array $params): Collection|MessageInterface|Rocket|null
58
+    public function __call(string $shortcut, array $params): Collection | MessageInterface | Rocket | null
59 59
     {
60
-        $plugin = '\Yansongda\Pay\Shortcut\Wechat\\'.Str::studly($shortcut).'Shortcut';
60
+        $plugin = '\Yansongda\Pay\Shortcut\Wechat\\' . Str::studly($shortcut) . 'Shortcut';
61 61
 
62 62
         return Artful::shortcut($plugin, ...$params);
63 63
     }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
      * @throws ContainerException
67 67
      * @throws InvalidParamsException
68 68
      */
69
-    public function pay(array $plugins, array $params): Collection|MessageInterface|Rocket|null
69
+    public function pay(array $plugins, array $params): Collection | MessageInterface | Rocket | null
70 70
     {
71 71
         return Artful::artful($plugins, $params);
72 72
     }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
      * @throws InvalidParamsException
77 77
      * @throws ServiceNotFoundException
78 78
      */
79
-    public function query(array $order): Collection|Rocket
79
+    public function query(array $order): Collection | Rocket
80 80
     {
81 81
         Event::dispatch(new MethodCalled('wechat', __METHOD__, $order, null));
82 82
 
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      * @throws InvalidParamsException
89 89
      * @throws ServiceNotFoundException
90 90
      */
91
-    public function cancel(array $order): Collection|Rocket
91
+    public function cancel(array $order): Collection | Rocket
92 92
     {
93 93
         Event::dispatch(new MethodCalled('wechat', __METHOD__, $order, null));
94 94
 
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
      * @throws InvalidParamsException
101 101
      * @throws ServiceNotFoundException
102 102
      */
103
-    public function close(array $order): Collection|Rocket
103
+    public function close(array $order): Collection | Rocket
104 104
     {
105 105
         Event::dispatch(new MethodCalled('wechat', __METHOD__, $order, null));
106 106
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      * @throws InvalidParamsException
115 115
      * @throws ServiceNotFoundException
116 116
      */
117
-    public function refund(array $order): Collection|Rocket
117
+    public function refund(array $order): Collection | Rocket
118 118
     {
119 119
         Event::dispatch(new MethodCalled('wechat', __METHOD__, $order, null));
120 120
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
      * @throws ContainerException
126 126
      * @throws InvalidParamsException
127 127
      */
128
-    public function callback(array|ServerRequestInterface|null $contents = null, ?array $params = null): Collection|Rocket
128
+    public function callback(array | ServerRequestInterface | null $contents = null, ?array $params = null): Collection | Rocket
129 129
     {
130 130
         $request = $this->getCallbackParams($contents);
131 131
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         );
156 156
     }
157 157
 
158
-    protected function getCallbackParams(array|ServerRequestInterface|null $contents = null): ServerRequestInterface
158
+    protected function getCallbackParams(array | ServerRequestInterface | null $contents = null): ServerRequestInterface
159 159
     {
160 160
         if (is_array($contents) && isset($contents['body'], $contents['headers'])) {
161 161
             return new ServerRequest('POST', 'http://localhost', $contents['headers'], $contents['body']);
Please login to merge, or discard this patch.
src/Provider/Jsb.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@  discard block
 block discarded – undo
45 45
      * @throws InvalidParamsException
46 46
      * @throws ServiceNotFoundException
47 47
      */
48
-    public function __call(string $name, array $params): Collection|MessageInterface|Rocket|null
48
+    public function __call(string $name, array $params): Collection | MessageInterface | Rocket | null
49 49
     {
50
-        $plugin = '\Yansongda\Pay\Shortcut\Jsb\\'.Str::studly($name).'Shortcut';
50
+        $plugin = '\Yansongda\Pay\Shortcut\Jsb\\' . Str::studly($name) . 'Shortcut';
51 51
 
52 52
         return Artful::shortcut($plugin, ...$params);
53 53
     }
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      * @throws ContainerException
57 57
      * @throws InvalidParamsException
58 58
      */
59
-    public function pay(array $plugins, array $params): Collection|MessageInterface|Rocket|null
59
+    public function pay(array $plugins, array $params): Collection | MessageInterface | Rocket | null
60 60
     {
61 61
         return Artful::artful($plugins, $params);
62 62
     }
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
     /**
74 74
      * @throws InvalidParamsException
75 75
      */
76
-    public function cancel(array $order): Collection|Rocket
76
+    public function cancel(array $order): Collection | Rocket
77 77
     {
78 78
         throw new InvalidParamsException(Exception::PARAMS_METHOD_NOT_SUPPORTED, 'Jsb does not support cancel api');
79 79
     }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     /**
82 82
      * @throws InvalidParamsException
83 83
      */
84
-    public function close(array $order): Collection|Rocket
84
+    public function close(array $order): Collection | Rocket
85 85
     {
86 86
         throw new InvalidParamsException(Exception::PARAMS_METHOD_NOT_SUPPORTED, 'Jsb does not support close api');
87 87
     }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
      * @throws InvalidParamsException
92 92
      * @throws ServiceNotFoundException
93 93
      */
94
-    public function refund(array $order): Collection|Rocket
94
+    public function refund(array $order): Collection | Rocket
95 95
     {
96 96
         Event::dispatch(new MethodCalled('jsb', __METHOD__, $order, null));
97 97
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      * @throws ContainerException
103 103
      * @throws InvalidParamsException
104 104
      */
105
-    public function callback(array|ServerRequestInterface|null $contents = null, ?array $params = null): Collection|Rocket
105
+    public function callback(array | ServerRequestInterface | null $contents = null, ?array $params = null): Collection | Rocket
106 106
     {
107 107
         $request = $this->getCallbackParams($contents);
108 108
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
      * @throws InvalidParamsException
129 129
      * @throws ServiceNotFoundException
130 130
      */
131
-    public function query(array $order): Collection|Rocket
131
+    public function query(array $order): Collection | Rocket
132 132
     {
133 133
         Event::dispatch(new MethodCalled('jsb', __METHOD__, $order, null));
134 134
 
Please login to merge, or discard this patch.
src/Provider/Douyin.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -46,9 +46,9 @@  discard block
 block discarded – undo
46 46
      * @throws InvalidParamsException
47 47
      * @throws ServiceNotFoundException
48 48
      */
49
-    public function __call(string $shortcut, array $params): Collection|MessageInterface|Rocket|null
49
+    public function __call(string $shortcut, array $params): Collection | MessageInterface | Rocket | null
50 50
     {
51
-        $plugin = '\Yansongda\Pay\Shortcut\Douyin\\'.Str::studly($shortcut).'Shortcut';
51
+        $plugin = '\Yansongda\Pay\Shortcut\Douyin\\' . Str::studly($shortcut) . 'Shortcut';
52 52
 
53 53
         return Artful::shortcut($plugin, ...$params);
54 54
     }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
      * @throws ContainerException
58 58
      * @throws InvalidParamsException
59 59
      */
60
-    public function pay(array $plugins, array $params): Collection|MessageInterface|Rocket|null
60
+    public function pay(array $plugins, array $params): Collection | MessageInterface | Rocket | null
61 61
     {
62 62
         return Artful::artful($plugins, $params);
63 63
     }
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      * @throws InvalidParamsException
68 68
      * @throws ServiceNotFoundException
69 69
      */
70
-    public function query(array $order): Collection|Rocket
70
+    public function query(array $order): Collection | Rocket
71 71
     {
72 72
         Event::dispatch(new MethodCalled('douyin', __METHOD__, $order, null));
73 73
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     /**
78 78
      * @throws InvalidParamsException
79 79
      */
80
-    public function cancel(array $order): Collection|Rocket
80
+    public function cancel(array $order): Collection | Rocket
81 81
     {
82 82
         throw new InvalidParamsException(Exception::PARAMS_METHOD_NOT_SUPPORTED, '参数异常: 抖音不支持 cancel API');
83 83
     }
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
     /**
86 86
      * @throws InvalidParamsException
87 87
      */
88
-    public function close(array $order): Collection|Rocket
88
+    public function close(array $order): Collection | Rocket
89 89
     {
90 90
         throw new InvalidParamsException(Exception::PARAMS_METHOD_NOT_SUPPORTED, '参数异常: 抖音不支持 close API');
91 91
     }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      * @throws InvalidParamsException
96 96
      * @throws ServiceNotFoundException
97 97
      */
98
-    public function refund(array $order): Collection|Rocket
98
+    public function refund(array $order): Collection | Rocket
99 99
     {
100 100
         Event::dispatch(new MethodCalled('douyin', __METHOD__, $order, null));
101 101
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      * @throws ContainerException
107 107
      * @throws InvalidParamsException
108 108
      */
109
-    public function callback(array|ServerRequestInterface|null $contents = null, ?array $params = null): Collection|Rocket
109
+    public function callback(array | ServerRequestInterface | null $contents = null, ?array $params = null): Collection | Rocket
110 110
     {
111 111
         $request = $this->getCallbackParams($contents);
112 112
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         );
134 134
     }
135 135
 
136
-    protected function getCallbackParams(array|ServerRequestInterface|null $contents = null): Collection
136
+    protected function getCallbackParams(array | ServerRequestInterface | null $contents = null): Collection
137 137
     {
138 138
         if (is_array($contents)) {
139 139
             return Collection::wrap($contents);
Please login to merge, or discard this patch.
src/Provider/Alipay.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -53,9 +53,9 @@  discard block
 block discarded – undo
53 53
      * @throws InvalidParamsException
54 54
      * @throws ServiceNotFoundException
55 55
      */
56
-    public function __call(string $shortcut, array $params): Collection|MessageInterface|Rocket|null
56
+    public function __call(string $shortcut, array $params): Collection | MessageInterface | Rocket | null
57 57
     {
58
-        $plugin = '\Yansongda\Pay\Shortcut\Alipay\\'.Str::studly($shortcut).'Shortcut';
58
+        $plugin = '\Yansongda\Pay\Shortcut\Alipay\\' . Str::studly($shortcut) . 'Shortcut';
59 59
 
60 60
         return Artful::shortcut($plugin, ...$params);
61 61
     }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      * @throws ContainerException
65 65
      * @throws InvalidParamsException
66 66
      */
67
-    public function pay(array $plugins, array $params): Collection|MessageInterface|Rocket|null
67
+    public function pay(array $plugins, array $params): Collection | MessageInterface | Rocket | null
68 68
     {
69 69
         return Artful::artful($plugins, $params);
70 70
     }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
      * @throws InvalidParamsException
75 75
      * @throws ServiceNotFoundException
76 76
      */
77
-    public function query(array $order): Collection|Rocket
77
+    public function query(array $order): Collection | Rocket
78 78
     {
79 79
         Event::dispatch(new MethodCalled('alipay', __METHOD__, $order, null));
80 80
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
      * @throws InvalidParamsException
87 87
      * @throws ServiceNotFoundException
88 88
      */
89
-    public function cancel(array $order): Collection|Rocket
89
+    public function cancel(array $order): Collection | Rocket
90 90
     {
91 91
         Event::dispatch(new MethodCalled('alipay', __METHOD__, $order, null));
92 92
 
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
      * @throws InvalidParamsException
99 99
      * @throws ServiceNotFoundException
100 100
      */
101
-    public function close(array $order): Collection|Rocket
101
+    public function close(array $order): Collection | Rocket
102 102
     {
103 103
         Event::dispatch(new MethodCalled('alipay', __METHOD__, $order, null));
104 104
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      * @throws InvalidParamsException
111 111
      * @throws ServiceNotFoundException
112 112
      */
113
-    public function refund(array $order): Collection|Rocket
113
+    public function refund(array $order): Collection | Rocket
114 114
     {
115 115
         Event::dispatch(new MethodCalled('alipay', __METHOD__, $order, null));
116 116
 
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
      * @throws ContainerException
122 122
      * @throws InvalidParamsException
123 123
      */
124
-    public function callback(array|ServerRequestInterface|null $contents = null, ?array $params = null): Collection
124
+    public function callback(array | ServerRequestInterface | null $contents = null, ?array $params = null): Collection
125 125
     {
126 126
         $request = $this->getCallbackParams($contents);
127 127
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
      * @throws ContainerException
135 135
      * @throws InvalidParamsException
136 136
      */
137
-    public function appCallback(array|ServerRequestInterface|null $contents = null, ?array $params = null): Collection
137
+    public function appCallback(array | ServerRequestInterface | null $contents = null, ?array $params = null): Collection
138 138
     {
139 139
         $request = $this->getCallbackParams($contents);
140 140
 
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         );
156 156
     }
157 157
 
158
-    protected function getCallbackParams(array|ServerRequestInterface|null $contents = null): Collection
158
+    protected function getCallbackParams(array | ServerRequestInterface | null $contents = null): Collection
159 159
     {
160 160
         if (is_array($contents)) {
161 161
             return Collection::wrap($contents);
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
@@ -49,9 +49,9 @@  discard block
 block discarded – undo
49 49
      * @throws InvalidParamsException
50 50
      * @throws ServiceNotFoundException
51 51
      */
52
-    public function __call(string $shortcut, array $params): Collection|MessageInterface|Rocket|null
52
+    public function __call(string $shortcut, array $params): Collection | MessageInterface | Rocket | null
53 53
     {
54
-        $plugin = '\Yansongda\Pay\Shortcut\Unipay\\'.Str::studly($shortcut).'Shortcut';
54
+        $plugin = '\Yansongda\Pay\Shortcut\Unipay\\' . Str::studly($shortcut) . 'Shortcut';
55 55
 
56 56
         return Artful::shortcut($plugin, ...$params);
57 57
     }
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      * @throws ContainerException
61 61
      * @throws InvalidParamsException
62 62
      */
63
-    public function pay(array $plugins, array $params): Collection|MessageInterface|Rocket|null
63
+    public function pay(array $plugins, array $params): Collection | MessageInterface | Rocket | null
64 64
     {
65 65
         return Artful::artful($plugins, $params);
66 66
     }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      * @throws InvalidParamsException
71 71
      * @throws ServiceNotFoundException
72 72
      */
73
-    public function query(array $order): Collection|Rocket
73
+    public function query(array $order): Collection | Rocket
74 74
     {
75 75
         Event::dispatch(new MethodCalled('unipay', __METHOD__, $order, null));
76 76
 
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      * @throws InvalidParamsException
83 83
      * @throws ServiceNotFoundException
84 84
      */
85
-    public function cancel(array $order): Collection|Rocket
85
+    public function cancel(array $order): Collection | Rocket
86 86
     {
87 87
         Event::dispatch(new MethodCalled('unipay', __METHOD__, $order, null));
88 88
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
     /**
93 93
      * @throws InvalidParamsException
94 94
      */
95
-    public function close(array $order): Collection|Rocket
95
+    public function close(array $order): Collection | Rocket
96 96
     {
97 97
         throw new InvalidParamsException(Exception::PARAMS_METHOD_NOT_SUPPORTED, '参数异常: 银联不支持 close API');
98 98
     }
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      * @throws InvalidParamsException
103 103
      * @throws ServiceNotFoundException
104 104
      */
105
-    public function refund(array $order): Collection|Rocket
105
+    public function refund(array $order): Collection | Rocket
106 106
     {
107 107
         Event::dispatch(new MethodCalled('unipay', __METHOD__, $order, null));
108 108
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      * @throws ContainerException
114 114
      * @throws InvalidParamsException
115 115
      */
116
-    public function callback(array|ServerRequestInterface|null $contents = null, ?array $params = null): Collection|Rocket
116
+    public function callback(array | ServerRequestInterface | null $contents = null, ?array $params = null): Collection | Rocket
117 117
     {
118 118
         $request = $this->getCallbackParams($contents);
119 119
 
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
         );
140 140
     }
141 141
 
142
-    protected function getCallbackParams(array|ServerRequestInterface|null $contents = null): Collection
142
+    protected function getCallbackParams(array | ServerRequestInterface | null $contents = null): Collection
143 143
     {
144 144
         if (is_array($contents)) {
145 145
             return Collection::wrap($contents);
Please login to merge, or discard this patch.
src/Event/CallbackReceived.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@
 block discarded – undo
14 14
 
15 15
     public ?array $params = null;
16 16
 
17
-    public array|ServerRequestInterface|null $contents;
17
+    public array | ServerRequestInterface | null $contents;
18 18
 
19
-    public function __construct(string $provider, array|ServerRequestInterface|null $contents, ?array $params = null, ?Rocket $rocket = null)
19
+    public function __construct(string $provider, array | ServerRequestInterface | null $contents, ?array $params = null, ?Rocket $rocket = null)
20 20
     {
21 21
         $this->provider = $provider;
22 22
         $this->contents = $contents;
Please login to merge, or discard this patch.
src/Pay.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     /**
73 73
      * @throws ContainerException
74 74
      */
75
-    public static function config(array $config = [], Closure|ContainerInterface|null $container = null): bool
75
+    public static function config(array $config = [], Closure | ContainerInterface | null $container = null): bool
76 76
     {
77 77
         $result = Artful::config($config, $container);
78 78
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
         return Artful::get($service);
108 108
     }
109 109
 
110
-    public static function setContainer(Closure|ContainerInterface|null $container): void
110
+    public static function setContainer(Closure | ContainerInterface | null $container): void
111 111
     {
112 112
         Artful::setContainer($container);
113 113
     }
Please login to merge, or discard this patch.