diff --git a/tests/SmsManagerTest.php b/tests/SmsManagerTest.php index 13912bb..b2be51d 100644 --- a/tests/SmsManagerTest.php +++ b/tests/SmsManagerTest.php @@ -93,10 +93,6 @@ private function sendString( ): string { $message = $this->formatMessage($message); - if (\is_array($message)) { - $message = new Message($message); - } - return $this->formatLog($number, $message); } @@ -257,12 +253,8 @@ private function prepareLoggerExpectation(?string $channel = null, string $level ->once(); } - private function formatLog(PhoneNumberInterface|string $number, MessageInterface|string $message): string + private function formatLog(PhoneNumberInterface|string $number, MessageInterface $message): string { - if (\is_string($message)) { - return sprintf('number: %s, message: "%s"', $number, $message); - } - return sprintf( 'number: %s, message: "%s", template: "%s", data: %s, type: %s', $number, @@ -331,12 +323,8 @@ static function (SmsSending $smsSending) use ($number, $expectedMessage): bool { /** * @param \Overtrue\EasySms\Contracts\MessageInterface|string|array $message - * - * @phpstan-return ($message is array ? array : \Overtrue\EasySms\Contracts\MessageInterface) - * - * @return \Overtrue\EasySms\Contracts\MessageInterface|array */ - private function formatMessage(MessageInterface|string|array $message): array|MessageInterface + private function formatMessage(MessageInterface|string|array $message): MessageInterface { if (\is_string($message)) { return new Message([