Skip to content

Commit

Permalink
Remove useless format
Browse files Browse the repository at this point in the history
  • Loading branch information
zingimmick committed Feb 23, 2023
1 parent 1308d12 commit 8176aa1
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions tests/SmsManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -331,12 +323,8 @@ static function (SmsSending $smsSending) use ($number, $expectedMessage): bool {

/**
* @param \Overtrue\EasySms\Contracts\MessageInterface|string|array<string, mixed> $message
*
* @phpstan-return ($message is array ? array<string, mixed> : \Overtrue\EasySms\Contracts\MessageInterface)
*
* @return \Overtrue\EasySms\Contracts\MessageInterface|array<string, mixed>
*/
private function formatMessage(MessageInterface|string|array $message): array|MessageInterface
private function formatMessage(MessageInterface|string|array $message): MessageInterface
{
if (\is_string($message)) {
return new Message([
Expand Down

0 comments on commit 8176aa1

Please sign in to comment.