@@ -51,10 +51,10 @@ discard block |
||
| 51 | 51 | * @throws InvalidParamsException |
| 52 | 52 | * @throws ServiceNotFoundException |
| 53 | 53 | */ |
| 54 | - public function __call(string $shortcut, array $params): null|array|Collection|MessageInterface |
|
| 54 | + public function __call(string $shortcut, array $params): null | array | 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 |
||
| 64 | 64 | * @throws InvalidParamsException |
| 65 | 65 | * @throws ServiceNotFoundException |
| 66 | 66 | */ |
| 67 | - public function find(array|string $order): Collection|array |
|
| 67 | + public function find(array | string $order): Collection | array |
|
| 68 | 68 | { |
| 69 | 69 | $order = is_array($order) ? $order : ['transaction_id' => $order]; |
| 70 | 70 | |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | /** |
| 77 | 77 | * @throws InvalidParamsException |
| 78 | 78 | */ |
| 79 | - public function cancel(array|string $order): null|Collection|array |
|
| 79 | + public function cancel(array | string $order): null | Collection | array |
|
| 80 | 80 | { |
| 81 | 81 | throw new InvalidParamsException(Exception::METHOD_NOT_SUPPORTED, 'Wechat does not support cancel api'); |
| 82 | 82 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * @throws InvalidParamsException |
| 87 | 87 | * @throws ServiceNotFoundException |
| 88 | 88 | */ |
| 89 | - public function close(array|string $order): null|Collection|array |
|
| 89 | + public function close(array | string $order): null | Collection | array |
|
| 90 | 90 | { |
| 91 | 91 | $order = is_array($order) ? $order : ['out_trade_no' => $order]; |
| 92 | 92 | |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | * @throws InvalidParamsException |
| 101 | 101 | * @throws ServiceNotFoundException |
| 102 | 102 | */ |
| 103 | - public function refund(array $order): Collection|array |
|
| 103 | + public function refund(array $order): Collection | array |
|
| 104 | 104 | { |
| 105 | 105 | Event::dispatch(new Event\MethodCalled('wechat', __METHOD__, $order, null)); |
| 106 | 106 | |
@@ -111,7 +111,7 @@ discard block |
||
| 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 |
||
| 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']); |
@@ -44,10 +44,10 @@ discard block |
||
| 44 | 44 | * @throws InvalidParamsException |
| 45 | 45 | * @throws ServiceNotFoundException |
| 46 | 46 | */ |
| 47 | - public function __call(string $shortcut, array $params): null|array|Collection|MessageInterface |
|
| 47 | + public function __call(string $shortcut, array $params): null | array | Collection | MessageInterface |
|
| 48 | 48 | { |
| 49 | - $plugin = '\\Yansongda\\Pay\\Plugin\\Alipay\\Shortcut\\'. |
|
| 50 | - Str::studly($shortcut).'Shortcut'; |
|
| 49 | + $plugin = '\\Yansongda\\Pay\\Plugin\\Alipay\\Shortcut\\' . |
|
| 50 | + Str::studly($shortcut) . 'Shortcut'; |
|
| 51 | 51 | |
| 52 | 52 | return $this->call($plugin, ...$params); |
| 53 | 53 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @throws InvalidParamsException |
| 58 | 58 | * @throws ServiceNotFoundException |
| 59 | 59 | */ |
| 60 | - public function find(array|string $order): Collection|array |
|
| 60 | + public function find(array | string $order): Collection | array |
|
| 61 | 61 | { |
| 62 | 62 | $order = is_array($order) ? $order : ['out_trade_no' => $order]; |
| 63 | 63 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | * @throws InvalidParamsException |
| 72 | 72 | * @throws ServiceNotFoundException |
| 73 | 73 | */ |
| 74 | - public function cancel(array|string $order): Collection|array|null |
|
| 74 | + public function cancel(array | string $order): Collection | array | null |
|
| 75 | 75 | { |
| 76 | 76 | $order = is_array($order) ? $order : ['out_trade_no' => $order]; |
| 77 | 77 | |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | * @throws InvalidParamsException |
| 86 | 86 | * @throws ServiceNotFoundException |
| 87 | 87 | */ |
| 88 | - public function close(array|string $order): Collection|array|null |
|
| 88 | + public function close(array | string $order): Collection | array | null |
|
| 89 | 89 | { |
| 90 | 90 | $order = is_array($order) ? $order : ['out_trade_no' => $order]; |
| 91 | 91 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | * @throws InvalidParamsException |
| 100 | 100 | * @throws ServiceNotFoundException |
| 101 | 101 | */ |
| 102 | - public function refund(array $order): Collection|array |
|
| 102 | + public function refund(array $order): Collection | array |
|
| 103 | 103 | { |
| 104 | 104 | Event::dispatch(new Event\MethodCalled('alipay', __METHOD__, $order, null)); |
| 105 | 105 | |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | * @throws ContainerException |
| 111 | 111 | * @throws InvalidParamsException |
| 112 | 112 | */ |
| 113 | - public function callback(null|array|ServerRequestInterface $contents = null, ?array $params = null): Collection |
|
| 113 | + public function callback(null | array | ServerRequestInterface $contents = null, ?array $params = null): Collection |
|
| 114 | 114 | { |
| 115 | 115 | $request = $this->getCallbackParams($contents); |
| 116 | 116 | |
@@ -137,15 +137,14 @@ discard block |
||
| 137 | 137 | ); |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | - protected function getCallbackParams(array|ServerRequestInterface $contents = null): Collection |
|
| 140 | + protected function getCallbackParams(array | ServerRequestInterface $contents = null): Collection |
|
| 141 | 141 | { |
| 142 | 142 | if (is_array($contents)) { |
| 143 | 143 | return Collection::wrap($contents); |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | if ($contents instanceof ServerRequestInterface) { |
| 147 | - return Collection::wrap('GET' === $contents->getMethod() ? $contents->getQueryParams() : |
|
| 148 | - $contents->getParsedBody()); |
|
| 147 | + return Collection::wrap('GET' === $contents->getMethod() ? $contents->getQueryParams() : $contents->getParsedBody()); |
|
| 149 | 148 | } |
| 150 | 149 | |
| 151 | 150 | $request = ServerRequest::fromGlobals(); |
@@ -39,10 +39,10 @@ discard block |
||
| 39 | 39 | * @throws InvalidParamsException |
| 40 | 40 | * @throws ServiceNotFoundException |
| 41 | 41 | */ |
| 42 | - public function __call(string $shortcut, array $params): null|array|Collection|MessageInterface |
|
| 42 | + public function __call(string $shortcut, array $params): null | array | 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 |
||
| 52 | 52 | * @throws InvalidParamsException |
| 53 | 53 | * @throws ServiceNotFoundException |
| 54 | 54 | */ |
| 55 | - public function find(array|string $order): Collection|array |
|
| 55 | + public function find(array | string $order): Collection | array |
|
| 56 | 56 | { |
| 57 | 57 | if (!is_array($order)) { |
| 58 | 58 | throw new InvalidParamsException(Exception::UNIPAY_FIND_STRING_NOT_SUPPORTED); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * @throws InvalidParamsException |
| 69 | 69 | * @throws ServiceNotFoundException |
| 70 | 70 | */ |
| 71 | - public function cancel(array|string $order): Collection|array|null |
|
| 71 | + public function cancel(array | string $order): Collection | array | null |
|
| 72 | 72 | { |
| 73 | 73 | if (!is_array($order)) { |
| 74 | 74 | throw new InvalidParamsException(Exception::UNIPAY_CANCEL_STRING_NOT_SUPPORTED); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | /** |
| 83 | 83 | * @throws InvalidParamsException |
| 84 | 84 | */ |
| 85 | - public function close(array|string $order): Collection|array|null |
|
| 85 | + public function close(array | string $order): Collection | array | null |
|
| 86 | 86 | { |
| 87 | 87 | throw new InvalidParamsException(Exception::METHOD_NOT_SUPPORTED, 'Unipay does not support close api'); |
| 88 | 88 | } |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | * @throws InvalidParamsException |
| 93 | 93 | * @throws ServiceNotFoundException |
| 94 | 94 | */ |
| 95 | - public function refund(array $order): Collection|array |
|
| 95 | + public function refund(array $order): Collection | array |
|
| 96 | 96 | { |
| 97 | 97 | Event::dispatch(new Event\MethodCalled('unipay', __METHOD__, $order, null)); |
| 98 | 98 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | * @throws ContainerException |
| 104 | 104 | * @throws InvalidParamsException |
| 105 | 105 | */ |
| 106 | - public function callback(null|array|ServerRequestInterface $contents = null, ?array $params = null): Collection |
|
| 106 | + public function callback(null | array | ServerRequestInterface $contents = null, ?array $params = null): Collection |
|
| 107 | 107 | { |
| 108 | 108 | $request = $this->getCallbackParams($contents); |
| 109 | 109 | |
@@ -130,7 +130,7 @@ discard block |
||
| 130 | 130 | ); |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | - protected function getCallbackParams(null|array|ServerRequestInterface $contents = null): Collection |
|
| 133 | + protected function getCallbackParams(null | array | ServerRequestInterface $contents = null): Collection |
|
| 134 | 134 | { |
| 135 | 135 | if (is_array($contents)) { |
| 136 | 136 | return Collection::wrap($contents); |