8000 Add IncompleteDsnException for DSN from · symfony/symfony@6573106 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6573106

Browse files
Add IncompleteDsnException for DSN from
1 parent cda77fc commit 6573106

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Symfony/Component/Notifier/Bridge/Infobip/InfobipTransportFactory.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Notifier\Bridge\Infobip;
1313

14+
use Symfony\Component\Notifier\Exception\IncompleteDsnException;
1415
use Symfony\Component\Notifier\Exception\UnsupportedSchemeException;
1516
use Symfony\Component\Notifier\Transport\AbstractTransportFactory;
1617
use Symfony\Component\Notifier\Transport\Dsn;
@@ -36,6 +37,10 @@ public function create(Dsn $dsn): TransportInterface
3637
$host = $dsn->getHost();
3738
$port = $dsn->getPort();
3839

40+
if (!$from) {
41+
throw new IncompleteDsnException('Missing from.', $dsn->getOriginalDsn());
42+
}
43+
3944
if ('infobip' === $scheme) {
4045
return (new InfobipTransport($username, $password, $from, $this->client, $this->dispatcher))->setHost($host)->setPort($port);
4146
}

0 commit comments

Comments
 (0)
0