@@ -48,8 +48,8 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function __call(string $shortcut, array $params) |
| 50 | 50 | { |
| 51 | - $plugin = '\\Yansongda\\Pay\\Plugin\\Alipay\\Shortcut\\'. |
|
| 52 | - Str::studly($shortcut).'Shortcut'; |
|
| 51 | + $plugin = '\\Yansongda\\Pay\\Plugin\\Alipay\\Shortcut\\' . |
|
| 52 | + 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): Collection|array |
|
| 62 | + public function find(array | string $order): Collection | array |
|
| 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): Collection|array|null |
|
| 76 | + public function cancel(array | string $order): Collection | array | null |
|
| 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): Collection|array|null |
|
| 90 | + public function close(array | string $order): Collection | array | null |
|
| 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): Collection|array |
|
| 104 | + public function refund(array $order): Collection | array |
|
| 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 | |
@@ -139,15 +139,14 @@ discard block |
||
| 139 | 139 | ); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - protected function getCallbackParams(array|ServerRequestInterface $contents = null): Collection |
|
| 142 | + protected function getCallbackParams(array | ServerRequestInterface $contents = null): Collection |
|
| 143 | 143 | { |
| 144 | 144 | if (is_array($contents)) { |
| 145 | 145 | return Collection::wrap($contents); |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | if ($contents instanceof ServerRequestInterface) { |
| 149 | - return Collection::wrap('GET' === $contents->getMethod() ? $contents->getQueryParams() : |
|
| 150 | - $contents->getParsedBody()); |
|
| 149 | + return Collection::wrap('GET' === $contents->getMethod() ? $contents->getQueryParams() : $contents->getParsedBody()); |
|
| 151 | 150 | } |
| 152 | 151 | |
| 153 | 152 | $request = ServerRequest::fromGlobals(); |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @throws InvalidParamsException |
| 36 | 36 | * @throws ServiceNotFoundException |
| 37 | 37 | */ |
| 38 | - public function call(string $plugin, array $params = []): Collection|MessageInterface|array|null |
|
| 38 | + public function call(string $plugin, array $params = []): Collection | MessageInterface | array | null |
|
| 39 | 39 | { |
| 40 | 40 | if (!class_exists($plugin) || !in_array(ShortcutInterface::class, class_implements($plugin))) { |
| 41 | 41 | throw new InvalidParamsException(Exception::SHORTCUT_NOT_FOUND, "[{$plugin}] is not incompatible"); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @throws ContainerException |
| 58 | 58 | * @throws InvalidParamsException |
| 59 | 59 | */ |
| 60 | - public function pay(array $plugins, array $params): Collection|MessageInterface|array|null |
|
| 60 | + public function pay(array $plugins, array $params): Collection | MessageInterface | array | null |
|
| 61 | 61 | { |
| 62 | 62 | Logger::info('[AbstractProvider] 即将进行 pay 操作', func_get_args()); |
| 63 | 63 | |
@@ -43,8 +43,8 @@ discard block |
||
| 43 | 43 | */ |
| 44 | 44 | public function __call(string $shortcut, array $params) |
| 45 | 45 | { |
| 46 | - $plugin = '\\Yansongda\\Pay\\Plugin\\Unipay\\Shortcut\\'. |
|
| 47 | - Str::studly($shortcut).'Shortcut'; |
|
| 46 | + $plugin = '\\Yansongda\\Pay\\Plugin\\Unipay\\Shortcut\\' . |
|
| 47 | + Str::studly($shortcut) . 'Shortcut'; |
|
| 48 | 48 | |
| 49 | 49 | return $this->call($plugin, ...$params); |
| 50 | 50 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * @throws InvalidParamsException |
| 55 | 55 | * @throws ServiceNotFoundException |
| 56 | 56 | */ |
| 57 | - public function find(array|string $order): Collection|array |
|
| 57 | + public function find(array | string $order): Collection | array |
|
| 58 | 58 | { |
| 59 | 59 | if (!is_array($order)) { |
| 60 | 60 | throw new InvalidParamsException(Exception::UNIPAY_FIND_STRING_NOT_SUPPORTED); |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | * @throws InvalidParamsException |
| 71 | 71 | * @throws ServiceNotFoundException |
| 72 | 72 | */ |
| 73 | - public function cancel(array|string $order): Collection|array|null |
|
| 73 | + public function cancel(array | string $order): Collection | array | null |
|
| 74 | 74 | { |
| 75 | 75 | if (!is_array($order)) { |
| 76 | 76 | throw new InvalidParamsException(Exception::UNIPAY_CANCEL_STRING_NOT_SUPPORTED); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | /** |
| 85 | 85 | * @throws InvalidParamsException |
| 86 | 86 | */ |
| 87 | - public function close(array|string $order): Collection|array|null |
|
| 87 | + public function close(array | string $order): Collection | array | null |
|
| 88 | 88 | { |
| 89 | 89 | throw new InvalidParamsException(Exception::METHOD_NOT_SUPPORTED, 'Unipay does not support close api'); |
| 90 | 90 | } |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * @throws InvalidParamsException |
| 95 | 95 | * @throws ServiceNotFoundException |
| 96 | 96 | */ |
| 97 | - public function refund(array $order): Collection|array |
|
| 97 | + public function refund(array $order): Collection | array |
|
| 98 | 98 | { |
| 99 | 99 | Event::dispatch(new Event\MethodCalled('unipay', __METHOD__, $order, null)); |
| 100 | 100 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | * @throws ContainerException |
| 106 | 106 | * @throws InvalidParamsException |
| 107 | 107 | */ |
| 108 | - public function callback(null|array|ServerRequestInterface $contents = null, ?array $params = null): Collection |
|
| 108 | + public function callback(null | array | ServerRequestInterface $contents = null, ?array $params = null): Collection |
|
| 109 | 109 | { |
| 110 | 110 | $request = $this->getCallbackParams($contents); |
| 111 | 111 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | ); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - protected function getCallbackParams(null|array|ServerRequestInterface $contents = null): Collection |
|
| 135 | + protected function getCallbackParams(null | array | ServerRequestInterface $contents = null): Collection |
|
| 136 | 136 | { |
| 137 | 137 | if (is_array($contents)) { |
| 138 | 138 | return Collection::wrap($contents); |