Skip to content

Commit 9fbdaf8

Browse files
committed
CS
1 parent 1969b8e commit 9fbdaf8

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

manager-bundle/src/ContaoManager/Plugin.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -571,11 +571,7 @@ private function getMailerDsnFromMailerUrl(string $mailerUrl): string
571571
private function getMailerDsn(ContainerBuilder $container): string
572572
{
573573
if (!$container->hasParameter('mailer_transport') || 'sendmail' === $container->getParameter('mailer_transport')) {
574-
if (class_exists(NativeTransportFactory::class)) {
575-
return 'native://default';
576-
}
577-
578-
return 'sendmail://default';
574+
return class_exists(NativeTransportFactory::class) ? 'native://default' : 'sendmail://default';
579575
}
580576

581577
$transport = 'smtp';

manager-bundle/tests/ContaoManager/PluginTest.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -612,14 +612,20 @@ public function testSetsTheMailerDsn(string $transport, ?string $host, ?string $
612612

613613
public function getMailerParameters(): \Generator
614614
{
615+
$default = 'sendmail://default';
616+
617+
if (class_exists(NativeTransportFactory::class)) {
618+
$default = 'native://default';
619+
}
620+
615621
yield [
616622
'mail',
617623
null,
618624
null,
619625
null,
620626
null,
621627
null,
622-
$this->supportsNativeMailer() ? 'native://default' : 'sendmail://default',
628+
$default,
623629
];
624630

625631
yield [
@@ -629,7 +635,7 @@ public function getMailerParameters(): \Generator
629635
null,
630636
25,
631637
null,
632-
$this->supportsNativeMailer() ? 'native://default' : 'sendmail://default',
638+
$default,
633639
];
634640

635641
yield [
@@ -909,9 +915,4 @@ private function getContainer(): PluginContainerBuilder
909915

910916
return $container;
911917
}
912-
913-
private function supportsNativeMailer(): bool
914-
{
915-
return class_exists(NativeTransportFactory::class);
916-
}
917918
}

0 commit comments

Comments
 (0)