Skip to content

Commit 262d772

Browse files
adrien-chinourfabpot
authored andcommitted
[Notifier] Add Amazon SNS bridge
1 parent f35c5df commit 262d772

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

Exception/UnsupportedSchemeException.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,10 @@ class UnsupportedSchemeException extends LogicException
148148
'class' => Bridge\Smsc\SmscTransportFactory::class,
149149
'package' => 'symfony/smsc-notifier',
150150
],
151+
'sns' => [
152+
'class' => Bridge\AmazonSns\AmazonSnsTransportFactory::class,
153+
'package' => 'symfony/amazon-sns-notifier',
154+
],
151155
'spothit' => [
152156
'class' => Bridge\SpotHit\SpotHitTransportFactory::class,
153157
'package' => 'symfony/spot-hit-notifier',

Tests/Exception/UnsupportedSchemeExceptionTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use PHPUnit\Framework\TestCase;
1515
use Symfony\Bridge\PhpUnit\ClassExistsMock;
1616
use Symfony\Component\Notifier\Bridge\AllMySms\AllMySmsTransportFactory;
17+
use Symfony\Component\Notifier\Bridge\AmazonSns\AmazonSnsTransportFactory;
1718
use Symfony\Component\Notifier\Bridge\Clickatell\ClickatellTransportFactory;
1819
use Symfony\Component\Notifier\Bridge\Discord\DiscordTransportFactory;
1920
use Symfony\Component\Notifier\Bridge\Esendex\EsendexTransportFactory;
@@ -63,6 +64,7 @@ public static function setUpBeforeClass(): void
6364
ClassExistsMock::register(__CLASS__);
6465
ClassExistsMock::withMockedClasses([
6566
AllMySmsTransportFactory::class => false,
67+
AmazonSnsTransportFactory::class => false,
6668
ClickatellTransportFactory::class => false,
6769
DiscordTransportFactory::class => false,
6870
EsendexTransportFactory::class => false,
@@ -118,6 +120,7 @@ public function testMessageWhereSchemeIsPartOfSchemeToPackageMap(string $scheme,
118120
public function messageWhereSchemeIsPartOfSchemeToPackageMapProvider(): \Generator
119121
{
120122
yield ['allmysms', 'symfony/allmysms-notifier'];
123+
yield ['sns', 'symfony/amazon-sns-notifier'];
121124
yield ['clickatell', 'symfony/clickatell-notifier'];
122125
yield ['discord', 'symfony/discord-notifier'];
123126
yield ['esendex', 'symfony/esendex-notifier'];

Transport.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Notifier;
1313

1414
use Symfony\Component\Notifier\Bridge\AllMySms\AllMySmsTransportFactory;
15+
use Symfony\Component\Notifier\Bridge\AmazonSns\AmazonSnsTransportFactory;
1516
use Symfony\Component\Notifier\Bridge\Clickatell\ClickatellTransportFactory;
1617
use Symfony\Component\Notifier\Bridge\Discord\DiscordTransportFactory;
1718
use Symfony\Component\Notifier\Bridge\Esendex\EsendexTransportFactory;
@@ -60,6 +61,7 @@ class Transport
6061
{
6162
private const FACTORY_CLASSES = [
6263
AllMySmsTransportFactory::class,
64+
AmazonSnsTransportFactory::class,
6365
ClickatellTransportFactory::class,
6466
DiscordTransportFactory::class,
6567
EsendexTransportFactory::class,

0 commit comments

Comments
 (0)