diff --git a/src/Core/SmsChannel.php b/src/Core/SmsChannel.php index 0ba81b6..093151e 100644 --- a/src/Core/SmsChannel.php +++ b/src/Core/SmsChannel.php @@ -58,6 +58,7 @@ public static function sections(): Collection */ private static function sendMessage(User $user, array $sections): bool { + // @phpstan-ignore-next-line if (!$user->phone) { return false; } diff --git a/src/Testing/SmsFake.php b/src/Testing/SmsFake.php index 323a43a..5865cc2 100644 --- a/src/Testing/SmsFake.php +++ b/src/Testing/SmsFake.php @@ -39,21 +39,21 @@ public function dispatch(): void $this->sms[] = new Sms($this->recipient, $this->body, [], []); } - public function assertSent(Closure $callback): void + public function assertSent(Closure|string $callback): void { PHPUnit::assertTrue( $this->sent($callback)->count() > 0, ); } - public function assertSentTimes(Closure $callback, int $times = 1): void + public function assertSentTimes(Closure|string $callback, int $times = 1): void { PHPUnit::assertCount( $times, $this->sent($callback) ); } - public function assertNotSent(Closure $callback): void + public function assertNotSent(Closure|string $callback): void { PHPUnit::assertCount( 0, $this->sent($callback) @@ -63,13 +63,13 @@ public function assertNotSent(Closure $callback): void /** * @return Collection */ - private function sent(Closure $callback = null): Collection + private function sent(Closure|string $callback = null): Collection { $callback = $this->prepare($callback); return (new Collection($this->sms))->filter($callback); } - private function prepare(Closure $callback = null): Closure + private function prepare(Closure|string $callback = null): Closure { if ($callback instanceof Closure) { $callback = function (Sms $sms) use ($callback) {