From 49d37c6356043559ee5ebb658948dfbc92be06df Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 10 Jul 2025 09:12:18 +0200 Subject: [PATCH] CS fixes --- ClickSendTransport.php | 10 +++++----- Tests/ClickSendTransportTest.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ClickSendTransport.php b/ClickSendTransport.php index 13f839b..65f48bc 100644 --- a/ClickSendTransport.php +++ b/ClickSendTransport.php @@ -37,7 +37,7 @@ public function __construct( private readonly ?string $listId = null, private readonly ?string $fromEmail = null, ?HttpClientInterface $client = null, - ?EventDispatcherInterface $dispatcher = null + ?EventDispatcherInterface $dispatcher = null, ) { parent::__construct($client, $dispatcher); } @@ -51,7 +51,7 @@ public function __toString(): string 'from_email' => $this->fromEmail, ]); - return sprintf('clicksend://%s%s', $this->getEndpoint(), $query ? '?'.http_build_query($query, '', '&') : ''); + return \sprintf('clicksend://%s%s', $this->getEndpoint(), $query ? '?'.http_build_query($query, '', '&') : ''); } public function supports(MessageInterface $message): bool @@ -68,7 +68,7 @@ protected function doSend(MessageInterface $message): SentMessage throw new UnsupportedMessageTypeException(__CLASS__, SmsMessage::class, $message); } - $endpoint = sprintf('https://%s/v3/sms/send', $this->getEndpoint()); + $endpoint = \sprintf('https://%s/v3/sms/send', $this->getEndpoint()); $options = $message->getOptions()?->toArray() ?? []; $options['body'] = $message->getSubject(); @@ -78,7 +78,7 @@ protected function doSend(MessageInterface $message): SentMessage $options['from_email'] ??= $this->fromEmail; if (isset($options['from']) && !preg_match('/^[a-zA-Z0-9\s]{3,11}$/', $options['from']) && !preg_match('/^\+[1-9]\d{1,14}$/', $options['from'])) { - throw new InvalidArgumentException(sprintf('The "From" number "%s" is not a valid phone number, shortcode, or alphanumeric sender ID.', $options['from'])); + throw new InvalidArgumentException(\sprintf('The "From" number "%s" is not a valid phone number, shortcode, or alphanumeric sender ID.', $options['from'])); } if (!$options['list_id']) { @@ -98,7 +98,7 @@ protected function doSend(MessageInterface $message): SentMessage if (200 !== $statusCode) { $error = $response->getContent(false); - throw new TransportException(sprintf('Unable to send the SMS - "%s".', $error ?: 'unknown failure'), $response); + throw new TransportException(\sprintf('Unable to send the SMS - "%s".', $error ?: 'unknown failure'), $response); } return new SentMessage($message, (string) $this); diff --git a/Tests/ClickSendTransportTest.php b/Tests/ClickSendTransportTest.php index c7d1fa8..532c5ac 100644 --- a/Tests/ClickSendTransportTest.php +++ b/Tests/ClickSendTransportTest.php @@ -49,7 +49,7 @@ public function testInvalidArgumentExceptionIsThrownIfFromIsInvalid(string $from $transport = $this->createTransport(null, $from); $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage(sprintf('The "From" number "%s" is not a valid phone number, shortcode, or alphanumeric sender ID.', $from)); + $this->expectExceptionMessage(\sprintf('The "From" number "%s" is not a valid phone number, shortcode, or alphanumeric sender ID.', $from)); $transport->send(new SmsMessage('+33612345678', 'Hello!')); }