8000 Prefix all sprintf() calls · symfony/click-send-notifier@070174e · GitHub
[go: up one dir, main page]

Skip to content

Commit 070174e

Browse files
committed
Prefix all sprintf() calls
1 parent 690df8d commit 070174e

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

ClickSendTransport.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __toString(): string
5151
'from_email' => $this->fromEmail,
5252
]);
5353

54-
return sprintf('clicksend://%s%s', $this->getEndpoint(), $query ? '?'.http_build_query($query, '', '&') : '');
54+
return \sprintf('clicksend://%s%s', $this->getEndpoint(), $query ? '?'.http_build_query($query, '', '&') : '');
5555
}
5656

5757
public function supports(MessageInterface $message): bool
@@ -68,7 +68,7 @@ protected function doSend(MessageInterface $message): SentMessage
6868
throw new UnsupportedMessageTypeException(__CLASS__, SmsMessage::class, $message);
6969
}
7070

71-
$endpoint = sprintf('https://%s/v3/sms/send', $this->getEndpoint());
71+
$endpoint = \sprintf('https://%s/v3/sms/send', $this->getEndpoint());
7272

7373
$options = $message->getOptions()?->toArray() ?? [];
7474
$options['body'] = $message->getSubject();
@@ -78,7 +78,7 @@ protected function doSend(MessageInterface $message): SentMessage
7878
$options['from_email'] ?? $this->fromEmail;
7979

8080
if (isset($options['from']) && !preg_match('/^[a-zA-Z0-9\s]{3,11}$/', $options['from']) && !preg_match('/^\+[1-9]\d{1,14}$/', $options['from'])) {
81-
throw new InvalidArgumentException(sprintf('The "From" number "%s" is not a valid phone number, shortcode, or alphanumeric sender ID.', $options['from']));
81+
throw new InvalidArgumentException(\sprintf('The "From" number "%s" is not a valid phone number, shortcode, or alphanumeric sender ID.', $options['from']));
8282
}
8383

8484
if ($options['list_id'] ?? false) {
@@ -98,7 +98,7 @@ protected function doSend(MessageInterface $message): SentMessage
9898

9999
if (200 !== $statusCode) {
100100
$error = $response->getContent(false);
101-
throw new TransportException(sprintf('Unable to send the SMS - "%s".', $error ?: 'unknown failure'), $response);
101+
throw new TransportException(\sprintf('Unable to send the SMS - "%s".', $error ?: 'unknown failure'), $response);
102102
}
103103

104104
return new SentMessage($message, (string) $this);

Tests/ClickSendTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function testInvalidArgumentExceptionIsThrownIfFromIsInvalid(string $from
4949
$transport = $this->createTransport(null, $from);
5050

5151
$this->expectException(InvalidArgumentException::class);
52-
$this->expectExceptionMessage(sprintf('The "From" number "%s" is not a valid phone number, shortcode, or alphanumeric sender ID.', $from));
52+
$this->expectExceptionMessage(\sprintf('The "From" number "%s" is not a valid phone number, shortcode, or alphanumeric sender ID.', $from));
5353

5454
$transport->send(new SmsMessage('+33612345678', 'Hello!'));
5555
}

0 commit comments

Comments
 (0)
0