diff --git a/src/Exceptions/CouldNotSendNotification.php b/src/Exceptions/CouldNotSendNotification.php index 137559d3ce775f92ca6c73edddd9268f298b5232..6b6b0c1b8393301c5adb8eb426f2cf3af98d264f 100644 --- a/src/Exceptions/CouldNotSendNotification.php +++ b/src/Exceptions/CouldNotSendNotification.php @@ -23,7 +23,6 @@ class CouldNotSendNotification extends Exception * Thrown when we're unable to communicate with smsc.ru. * * @param DomainException $exception - * * @return static */ public static function smscRespondedWithAnError(DomainException $exception): self @@ -39,7 +38,6 @@ class CouldNotSendNotification extends Exception * Thrown when we're unable to communicate with smsc.ru. * * @param Exception $exception - * * @return static */ public static function couldNotCommunicateWithSmsc(Exception $exception): self diff --git a/src/SmscRuApi.php b/src/SmscRuApi.php index ea55584c2eafff0a3f816d1ac7f79f32d0448454..193a4f8acfb61e1e98f2e95898700019e8c62fc5 100644 --- a/src/SmscRuApi.php +++ b/src/SmscRuApi.php @@ -47,10 +47,10 @@ class SmscRuApi { $base = [ 'charset' => 'utf-8', - 'login' => $this->login, - 'psw' => $this->secret, - 'sender' => $this->sender, - 'fmt' => self::FORMAT_JSON, + 'login' => $this->login, + 'psw' => $this->secret, + 'sender' => $this->sender, + 'fmt' => self::FORMAT_JSON, ]; $params = \array_merge($base, \array_filter($params), $this->extra); diff --git a/src/SmscRuChannel.php b/src/SmscRuChannel.php index dcfd14fcad923426729417e58783731171f0c162..9cd0cde3cdf50a1aa83088fa008314f673ff2893 100644 --- a/src/SmscRuChannel.php +++ b/src/SmscRuChannel.php @@ -20,10 +20,9 @@ class SmscRuChannel * * @param mixed $notifiable * @param Notification $notification + * @return array|null * * @throws CouldNotSendNotification - * - * @return array|null */ public function send($notifiable, Notification $notification): ?array { @@ -45,7 +44,6 @@ class SmscRuChannel * * @param mixed $notifiable * @param Notification $notification - * * @return string[] */ protected function getRecipients($notifiable, Notification $notification): array @@ -66,9 +64,9 @@ class SmscRuChannel } $params = [ - 'phones' => \implode(',', $recipients), - 'mes' => $message->content, - 'sender' => $message->from, + 'phones' => \implode(',', $recipients), + 'mes' => $message->content, + 'sender' => $message->from, ]; if ($message->sendAt instanceof \DateTimeInterface) { diff --git a/src/SmscRuMessage.php b/src/SmscRuMessage.php index a0c615379744f397f018f6c8298db9da88e97376..b84deeead54c47043b11f7b32a8257af32317fbc 100644 --- a/src/SmscRuMessage.php +++ b/src/SmscRuMessage.php @@ -28,8 +28,7 @@ class SmscRuMessage /** * Create a new message instance. * - * @param string $content - * + * @param string $content * @return static */ public static function create($content = '') @@ -49,7 +48,6 @@ class SmscRuMessage * Set the message content. * * @param string $content - * * @return $this */ public function content($content) @@ -63,7 +61,6 @@ class SmscRuMessage * Set the phone number or sender name the message should be sent from. * * @param string $from - * * @return $this */ public function from($from) @@ -77,10 +74,9 @@ class SmscRuMessage * Set the time the message should be sent. * * @param \DateTimeInterface|null $sendAt - * * @return $this */ - public function sendAt(\DateTimeInterface $sendAt = null) + public function sendAt(?\DateTimeInterface $sendAt = null) { $this->sendAt = $sendAt; diff --git a/tests/SmscRuApiTest.php b/tests/SmscRuApiTest.php index 013e5ab50c0775575327462708530e1fcb5e1fab..4e91d08ef6cec7999a4c530b271bf474bb7128ec 100644 --- a/tests/SmscRuApiTest.php +++ b/tests/SmscRuApiTest.php @@ -10,7 +10,7 @@ class SmscRuApiTest extends TestCase public function test_it_has_config_with_default_endpoint(): void { $smsc = $this->getExtendedSmscRuApi([ - 'login' => $login = 'login', + 'login' => $login = 'login', 'secret' => $secret = 'secret', 'sender' => $sender = 'sender', ]); diff --git a/tests/SmscRuChannelTest.php b/tests/SmscRuChannelTest.php index bba36f774440ac1a6be7a3b94e83444e54aea2c7..5a569651d8030b3d91abd63000f64b9c0c05bd54 100644 --- a/tests/SmscRuChannelTest.php +++ b/tests/SmscRuChannelTest.php @@ -45,9 +45,9 @@ class SmscRuChannelTest extends TestCase $this->smsc->shouldReceive('send') ->once() ->with([ - 'phones' => '+1234567890', - 'mes' => 'hello', - 'sender' => 'John_Doe', + 'phones' => '+1234567890', + 'mes' => 'hello', + 'sender' => 'John_Doe', ]); $this->channel->send(new TestNotifiable(), new TestNotification()); @@ -60,10 +60,10 @@ class SmscRuChannelTest extends TestCase $this->smsc->shouldReceive('send') ->once() ->with([ - 'phones' => '+1234567890', - 'mes' => 'hello', - 'sender' => 'John_Doe', - 'time' => '0'.self::$sendAt->getTimestamp(), + 'phones' => '+1234567890', + 'mes' => 'hello', + 'sender' => 'John_Doe', + 'time' => '0'.self::$sendAt->getTimestamp(), ]); $this->channel->send(new TestNotifiable(), new TestNotificationWithSendAt()); @@ -83,9 +83,9 @@ class SmscRuChannelTest extends TestCase $this->smsc->shouldReceive('send') ->once() ->with([ - 'phones' => '+1234567890,+0987654321,+1234554321', - 'mes' => 'hello', - 'sender' => 'John_Doe', + 'phones' => '+1234567890,+0987654321,+1234554321', + 'mes' => 'hello', + 'sender' => 'John_Doe', ]); $this->channel->send(new TestNotifiableWithManyPhones(), new TestNotification());