@@ -47,9 +47,9 @@ discard block |
||
| 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 |
||
| 59 | 59 | * @throws InvalidParamsException |
| 60 | 60 | * @throws ServiceNotFoundException |
| 61 | 61 | */ |
| 62 | - public function find(array|string $order): array|Collection |
|
| 62 | + public function find(array | string $order): array | Collection |
|
| 63 | 63 | { |
| 64 | 64 | $order = is_array($order) ? $order : ['out_trade_no' => $order]; |
| 65 | 65 | |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | * @throws InvalidParamsException |
| 74 | 74 | * @throws ServiceNotFoundException |
| 75 | 75 | */ |
| 76 | - public function cancel(array|string $order): null|array|Collection |
|
| 76 | + public function cancel(array | string $order): null | array | Collection |
|
| 77 | 77 | { |
| 78 | 78 | $order = is_array($order) ? $order : ['out_trade_no' => $order]; |
| 79 | 79 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | * @throws InvalidParamsException |
| 88 | 88 | * @throws ServiceNotFoundException |
| 89 | 89 | */ |
| 90 | - public function close(array|string $order): null|array|Collection |
|
| 90 | + public function close(array | string $order): null | array | Collection |
|
| 91 | 91 | { |
| 92 | 92 | $order = is_array($order) ? $order : ['out_trade_no' => $order]; |
| 93 | 93 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | * @throws InvalidParamsException |
| 102 | 102 | * @throws ServiceNotFoundException |
| 103 | 103 | */ |
| 104 | - public function refund(array $order): array|Collection |
|
| 104 | + public function refund(array $order): array | Collection |
|
| 105 | 105 | { |
| 106 | 106 | Event::dispatch(new Event\MethodCalled('alipay', __METHOD__, $order, null)); |
| 107 | 107 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * @throws ContainerException |
| 113 | 113 | * @throws InvalidParamsException |
| 114 | 114 | */ |
| 115 | - public function callback(null|array|ServerRequestInterface $contents = null, ?array $params = null): Collection |
|
| 115 | + public function callback(null | array | ServerRequestInterface $contents = null, ?array $params = null): Collection |
|
| 116 | 116 | { |
| 117 | 117 | $request = $this->getCallbackParams($contents); |
| 118 | 118 | |
@@ -138,15 +138,14 @@ discard block |
||
| 138 | 138 | ); |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - protected function getCallbackParams(array|ServerRequestInterface $contents = null): Collection |
|
| 141 | + protected function getCallbackParams(array | ServerRequestInterface $contents = null): Collection |
|
| 142 | 142 | { |
| 143 | 143 | if (is_array($contents)) { |
| 144 | 144 | return Collection::wrap($contents); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | if ($contents instanceof ServerRequestInterface) { |
| 148 | - return Collection::wrap('GET' === $contents->getMethod() ? $contents->getQueryParams() : |
|
| 149 | - $contents->getParsedBody()); |
|
| 148 | + return Collection::wrap('GET' === $contents->getMethod() ? $contents->getQueryParams() : $contents->getParsedBody()); |
|
| 150 | 149 | } |
| 151 | 150 | |
| 152 | 151 | $request = ServerRequest::fromGlobals(); |