Skip to content

Commit ef84e66

Browse files
[Notifier] cs
1 parent 8e5d8bc commit ef84e66

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

src/Symfony/Component/Notifier/Bridge/FakeChat/FakeChatTransportFactory.php

+5-7
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,15 @@ public function create(Dsn $dsn): TransportInterface
3838
{
3939
$scheme = $dsn->getScheme();
4040

41-
if (!\in_array($scheme, $this->getSupportedSchemes())) {
41+
if ('fakechat+email' !== $scheme) {
4242
throw new UnsupportedSchemeException($dsn, 'fakechat', $this->getSupportedSchemes());
4343
}
4444

45-
if ('fakechat+email' === $scheme) {
46-
$mailerTransport = $dsn->getHost();
47-
$to = $dsn->getRequiredOption('to');
48-
$from = $dsn->getRequiredOption('from');
45+
$mailerTransport = $dsn->getHost();
46+
$to = $dsn->getRequiredOption('to');
47+
$from = $dsn->getRequiredOption('from');
4948

50-
return (new FakeChatEmailTransport($this->mailer, $to, $from))->setHost($mailerTransport);
51-
}
49+
return (new FakeChatEmailTransport($this->mailer, $to, $from))->setHost($mailerTransport);
5250
}
5351

5452
protected function getSupportedSchemes(): array

src/Symfony/Component/Notifier/Bridge/FakeSms/FakeSmsTransportFactory.php

+5-7
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,15 @@ public function create(Dsn $dsn): TransportInterface
3939
{
4040
$scheme = $dsn->getScheme();
4141

42-
if (!\in_array($scheme, $this->getSupportedSchemes())) {
42+
if ('fakesms+email' !== $scheme) {
4343
throw new UnsupportedSchemeException($dsn, 'fakesms', $this->getSupportedSchemes());
4444
}
4545

46-
if ('fakesms+email' === $scheme) {
47-
$mailerTransport = $dsn->getHost();
48-
$to = $dsn->getRequiredOption('to');
49-
$from = $dsn->getRequiredOption('from');
46+
$mailerTransport = $dsn->getHost();
47+
$to = $dsn->getRequiredOption('to');
48+
$from = $dsn->getRequiredOption('from');
5049

51-
return (new FakeSmsEmailTransport($this->mailer, $to, $from))->setHost($mailerTransport);
52-
}
50+
return (new FakeSmsEmailTransport($this->mailer, $to, $from))->setHost($mailerTransport);
5351
}
5452

5553
protected function getSupportedSchemes(): array

0 commit comments

Comments
 (0)