@@ -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 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 |
||
| 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 |
||
| 83 | 83 | * @throws InvalidParamsException |
| 84 | 84 | * @throws ServiceNotFoundException |
| 85 | 85 | */ |
| 86 | - public function close(array $order): null|array|Collection |
|
| 86 | + public function close(array $order): null | array | Collection |
|
| 87 | 87 | { |
| 88 | 88 | Event::dispatch(new Event\MethodCalled('alipay', __METHOD__, $order, null)); |
| 89 | 89 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * @throws InvalidParamsException |
| 96 | 96 | * @throws ServiceNotFoundException |
| 97 | 97 | */ |
| 98 | - public function refund(array $order): array|Collection |
|
| 98 | + public function refund(array $order): array | Collection |
|
| 99 | 99 | { |
| 100 | 100 | Event::dispatch(new Event\MethodCalled('alipay', __METHOD__, $order, null)); |
| 101 | 101 | |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | * @throws ContainerException |
| 107 | 107 | * @throws InvalidParamsException |
| 108 | 108 | */ |
| 109 | - public function callback(null|array|ServerRequestInterface $contents = null, ?array $params = null): Collection |
|
| 109 | + public function callback(null | array | ServerRequestInterface $contents = null, ?array $params = null): Collection |
|
| 110 | 110 | { |
| 111 | 111 | $request = $this->getCallbackParams($contents); |
| 112 | 112 | |
@@ -132,15 +132,14 @@ discard block |
||
| 132 | 132 | ); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - protected function getCallbackParams(array|ServerRequestInterface $contents = null): Collection |
|
| 135 | + protected function getCallbackParams(array | ServerRequestInterface $contents = null): Collection |
|
| 136 | 136 | { |
| 137 | 137 | if (is_array($contents)) { |
| 138 | 138 | return Collection::wrap($contents); |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | if ($contents instanceof ServerRequestInterface) { |
| 142 | - return Collection::wrap('GET' === $contents->getMethod() ? $contents->getQueryParams() : |
|
| 143 | - $contents->getParsedBody()); |
|
| 142 | + return Collection::wrap('GET' === $contents->getMethod() ? $contents->getQueryParams() : $contents->getParsedBody()); |
|
| 144 | 143 | } |
| 145 | 144 | |
| 146 | 145 | $request = ServerRequest::fromGlobals(); |
@@ -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|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 |
||
| 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 |
||
| 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 |
||
| 84 | 84 | * @throws InvalidParamsException |
| 85 | 85 | * @throws ServiceNotFoundException |
| 86 | 86 | */ |
| 87 | - public function close(array $order): null|array|Collection |
|
| 87 | + public function close(array $order): null | array | Collection |
|
| 88 | 88 | { |
| 89 | 89 | Event::dispatch(new Event\MethodCalled('wechat', __METHOD__, $order, null)); |
| 90 | 90 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * @throws InvalidParamsException |
| 99 | 99 | * @throws ServiceNotFoundException |
| 100 | 100 | */ |
| 101 | - public function refund(array $order): array|Collection |
|
| 101 | + public function refund(array $order): array | Collection |
|
| 102 | 102 | { |
| 103 | 103 | Event::dispatch(new Event\MethodCalled('wechat', __METHOD__, $order, null)); |
| 104 | 104 | |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * @throws ContainerException |
| 110 | 110 | * @throws InvalidParamsException |
| 111 | 111 | */ |
| 112 | - public function callback(null|array|ServerRequestInterface $contents = null, ?array $params = null): Collection |
|
| 112 | + public function callback(null | array | ServerRequestInterface $contents = null, ?array $params = null): Collection |
|
| 113 | 113 | { |
| 114 | 114 | $request = $this->getCallbackParams($contents); |
| 115 | 115 | |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | ); |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | - protected function getCallbackParams(null|array|ServerRequestInterface $contents = null): ServerRequestInterface |
|
| 143 | + protected function getCallbackParams(null | array | ServerRequestInterface $contents = null): ServerRequestInterface |
|
| 144 | 144 | { |
| 145 | 145 | if (is_array($contents) && isset($contents['body'], $contents['headers'])) { |
| 146 | 146 | return new ServerRequest('POST', 'http://localhost', $contents['headers'], $contents['body']); |
@@ -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|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 |
||
| 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 |
||
| 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 |
||
| 74 | 74 | /** |
| 75 | 75 | * @throws InvalidParamsException |
| 76 | 76 | */ |
| 77 | - public function close(array $order): null|array|Collection |
|
| 77 | + public function close(array $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 |
||
| 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 |
||
| 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 |
||
| 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); |
@@ -19,17 +19,17 @@ |
||
| 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 $order): null|array|Collection; |
|
| 28 | + public function close(array $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 | } |