From 1233f1155258205b5aac3c521491180345831cde Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Thu, 20 Jun 2024 17:52:34 +0200 Subject: [PATCH 1/4] Prefix all sprintf() calls --- SmsapiTransport.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SmsapiTransport.php b/SmsapiTransport.php index b6d3e80..d6c789b 100644 --- a/SmsapiTransport.php +++ b/SmsapiTransport.php @@ -70,7 +70,7 @@ public function __toString(): string 'test' => (int) $this->test, ]); - return sprintf('smsapi://%s%s', $this->getEndpoint(), $query ? '?'.http_build_query($query, '', '&') : ''); + return \sprintf('smsapi://%s%s', $this->getEndpoint(), $query ? '?'.http_build_query($query, '', '&') : ''); } public function supports(MessageInterface $message): bool @@ -98,7 +98,7 @@ protected function doSend(MessageInterface $message): SentMessage $body['from'] = $from; } - $endpoint = sprintf('https://%s/sms.do', $this->getEndpoint()); + $endpoint = \sprintf('https://%s/sms.do', $this->getEndpoint()); $response = $this->client->request('POST', $endpoint, [ 'auth_bearer' => $this->authToken, 'body' => $body, @@ -117,7 +117,7 @@ protected function doSend(MessageInterface $message): SentMessage } if (isset($content['error']) || 200 !== $statusCode) { - throw new TransportException(sprintf('Unable to send the SMS: "%s".', $content['message'] ?? 'unknown error'), $response); + throw new TransportException(\sprintf('Unable to send the SMS: "%s".', $content['message'] ?? 'unknown error'), $response); } $sentMessage = new SentMessage($message, (string) $this); From 4bfbadda87b6b6938d36582efb0a75fa8e12ec92 Mon Sep 17 00:00:00 2001 From: Dariusz Ruminski Date: Sun, 16 Jun 2024 17:17:26 +0200 Subject: [PATCH 2/4] chore: CS fixes --- SmsapiTransport.php | 1 - 1 file changed, 1 deletion(-) diff --git a/SmsapiTransport.php b/SmsapiTransport.php index d6c789b..20152e7 100644 --- a/SmsapiTransport.php +++ b/SmsapiTransport.php @@ -38,7 +38,6 @@ public function __construct( ?HttpClientInterface $client = null, ?EventDispatcherInterface $dispatcher = null, ) { - parent::__construct($client, $dispatcher); } From 0f0cbca04cfd7e28198cee8a56df9649d837bf2a Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 6 Jul 2024 09:57:16 +0200 Subject: [PATCH 3/4] Update .gitattributes --- .gitattributes | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitattributes b/.gitattributes index 84c7add..14c3c35 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,3 @@ /Tests export-ignore /phpunit.xml.dist export-ignore -/.gitattributes export-ignore -/.gitignore export-ignore +/.git* export-ignore From 8b76d19b04051cc88a65abfc5bfa27ed8487da93 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 18 Sep 2024 13:58:19 +0200 Subject: [PATCH 4/4] deprecate the TransportFactoryTestCase --- Tests/SmsapiTransportFactoryTest.php | 7 +++++-- composer.json | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Tests/SmsapiTransportFactoryTest.php b/Tests/SmsapiTransportFactoryTest.php index 02995eb..fd19a6a 100644 --- a/Tests/SmsapiTransportFactoryTest.php +++ b/Tests/SmsapiTransportFactoryTest.php @@ -12,10 +12,13 @@ namespace Symfony\Component\Notifier\Bridge\Smsapi\Tests; use Symfony\Component\Notifier\Bridge\Smsapi\SmsapiTransportFactory; -use Symfony\Component\Notifier\Test\TransportFactoryTestCase; +use Symfony\Component\Notifier\Test\AbstractTransportFactoryTestCase; +use Symfony\Component\Notifier\Test\IncompleteDsnTestTrait; -final class SmsapiTransportFactoryTest extends TransportFactoryTestCase +final class SmsapiTransportFactoryTest extends AbstractTransportFactoryTestCase { + use IncompleteDsnTestTrait; + public function createFactory(): SmsapiTransportFactory { return new SmsapiTransportFactory(); diff --git a/composer.json b/composer.json index 5490e7c..656d455 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "require": { "php": ">=8.2", "symfony/http-client": "^6.4|^7.0", - "symfony/notifier": "^6.4|^7.0" + "symfony/notifier": "^7.2" }, "autoload": { "psr-4": { "Symfony\\Component\\Notifier\\Bridge\\Smsapi\\": "" },