@@ -35,7 +35,7 @@ |
||
| 35 | 35 | |
| 36 | 36 | public const ENDPOINT_FORMAT = 'json'; |
| 37 | 37 | |
| 38 | - public const ENDPOINT_REGION = '86'; // 中国区,目前只支持此国别 |
|
| 38 | + public const ENDPOINT_REGION = '86'; // 中国区,目前只支持此国别 |
|
| 39 | 39 | |
| 40 | 40 | public const SUCCESS_CODE = 200; |
| 41 | 41 | |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | /** |
| 24 | 24 | * @return array |
| 25 | 25 | */ |
| 26 | - public function send(PhoneNumberInterface|array $to, MessageInterface $message, Config $config) |
|
| 26 | + public function send(PhoneNumberInterface | array $to, MessageInterface $message, Config $config) |
|
| 27 | 27 | { |
| 28 | 28 | if (is_array($to)) { |
| 29 | 29 | $to = implode(',', $to); |
@@ -23,11 +23,11 @@ discard block |
||
| 23 | 23 | |
| 24 | 24 | protected string $type; |
| 25 | 25 | |
| 26 | - protected \Closure|string|null $content = null; |
|
| 26 | + protected \Closure | string | null $content = null; |
|
| 27 | 27 | |
| 28 | - protected \Closure|string|null $template = null; |
|
| 28 | + protected \Closure | string | null $template = null; |
|
| 29 | 29 | |
| 30 | - protected array|\Closure $data = []; |
|
| 30 | + protected array | \Closure $data = []; |
|
| 31 | 31 | |
| 32 | 32 | /** |
| 33 | 33 | * Message constructor. |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | /** |
| 106 | 106 | * @return $this |
| 107 | 107 | */ |
| 108 | - public function setData(callable|array $data): static |
|
| 108 | + public function setData(callable | array $data): static |
|
| 109 | 109 | { |
| 110 | 110 | $this->data = $data; |
| 111 | 111 | |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | /** |
| 27 | 27 | * 18888888888. |
| 28 | 28 | */ |
| 29 | - public function getNumber(): int|string; |
|
| 29 | + public function getNumber(): int | string; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * +8618888888888. |
@@ -18,14 +18,14 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | class PhoneNumber implements Contracts\PhoneNumberInterface |
| 20 | 20 | { |
| 21 | - protected int|string $number; |
|
| 21 | + protected int | string $number; |
|
| 22 | 22 | |
| 23 | 23 | protected ?int $IDDCode; |
| 24 | 24 | |
| 25 | 25 | /** |
| 26 | 26 | * PhoneNumberInterface constructor. |
| 27 | 27 | */ |
| 28 | - public function __construct(int|string $numberWithoutIDDCode, ?string $IDDCode = null) |
|
| 28 | + public function __construct(int | string $numberWithoutIDDCode, ?string $IDDCode = null) |
|
| 29 | 29 | { |
| 30 | 30 | $this->number = $numberWithoutIDDCode; |
| 31 | 31 | $this->IDDCode = $IDDCode ? intval(ltrim($IDDCode, '+0')) : null; |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | /** |
| 43 | 43 | * 18888888888. |
| 44 | 44 | */ |
| 45 | - public function getNumber(): int|string |
|
| 45 | + public function getNumber(): int | string |
|
| 46 | 46 | { |
| 47 | 47 | return $this->number; |
| 48 | 48 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * @throws NoGatewayAvailableException |
| 54 | 54 | * @throws InvalidArgumentException |
| 55 | 55 | */ |
| 56 | - public function send(array|string $to, MessageInterface|array $message, array $gateways = []): array |
|
| 56 | + public function send(array | string $to, MessageInterface | array $message, array $gateways = []): array |
|
| 57 | 57 | { |
| 58 | 58 | $to = $this->formatPhoneNumber($to); |
| 59 | 59 | $message = $this->formatMessage($message); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | if (!\class_exists($strategy)) { |
| 95 | - $strategy = __NAMESPACE__ . '\Strategies\\' . \ucfirst($strategy); |
|
| 95 | + $strategy = __NAMESPACE__.'\Strategies\\'.\ucfirst($strategy); |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | if (!\class_exists($strategy)) { |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | $name = \ucfirst(\str_replace(['-', '_', ''], '', $name)); |
| 185 | 185 | |
| 186 | - return __NAMESPACE__ . "\\Gateways\\{$name}Gateway"; |
|
| 186 | + return __NAMESPACE__."\\Gateways\\{$name}Gateway"; |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | return \call_user_func($this->customCreators[$gateway], $config); |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | - protected function formatPhoneNumber(PhoneNumberInterface|string $number): PhoneNumberInterface |
|
| 197 | + protected function formatPhoneNumber(PhoneNumberInterface | string $number): PhoneNumberInterface |
|
| 198 | 198 | { |
| 199 | 199 | if ($number instanceof PhoneNumberInterface) { |
| 200 | 200 | return $number; |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | return new PhoneNumber(\trim($number)); |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | - protected function formatMessage(MessageInterface|array|string $message): MessageInterface |
|
| 206 | + protected function formatMessage(MessageInterface | array | string $message): MessageInterface |
|
| 207 | 207 | { |
| 208 | 208 | if (!($message instanceof MessageInterface)) { |
| 209 | 209 | if (!\is_array($message)) { |
@@ -183,7 +183,7 @@ |
||
| 183 | 183 | |
| 184 | 184 | $name = \ucfirst(\str_replace(['-', '_', ''], '', $name)); |
| 185 | 185 | |
| 186 | - return __NAMESPACE__ . "\\Gateways\\{$name}Gateway"; |
|
| 186 | + return __NAMESPACE__ . "\\Gateways\\{$name}gateway"; |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | /** |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | $isSuccessful = true; |
| 58 | 58 | |
| 59 | 59 | break; |
| 60 | - } catch (\Exception|\Throwable $e) { |
|
| 60 | + } catch (\Exception | \Throwable $e) { |
|
| 61 | 61 | $results[$gateway] = [ |
| 62 | 62 | 'gateway' => $gateway, |
| 63 | 63 | 'status' => self::STATUS_FAILURE, |