8000 bug #49696 Fix DI logic when mailer is available but webhook is not (… · symfony/symfony@9aa6e08 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9aa6e08

Browse files
committed
bug #49696 Fix DI logic when mailer is available but webhook is not (fabpot)
This PR was merged into the 6.3 branch. Discussion ---------- Fix DI logic when mailer is available but webhook is not | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | n/a | License | MIT | Doc PR | n/a Commits ------- 80cb3f5 Fix DI logic when mailer is available but webhook is not
2 parents c918829 + 80cb3f5 commit 9aa6e08

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2527,16 +2527,18 @@ private function registerMailerConfiguration(array $config, ContainerBuilder $co
25272527
}
25282528
}
25292529

2530-
$webhookRequestParsers = [
2531-
MailgunRequestParser::class => 'mailer.webhook.request_parser.mailgun',
2532-
PostmarkRequestParser::class => 'mailer.webhook.request_parser.postmark',
2533-
];
2530+
if ($webhookEnabled) {
2531+
$webhookRequestParsers = [
2532+
MailgunRequestParser::class => 'mailer.webhook.request_parser.mailgun',
2533+
PostmarkRequestParser::class => 'mailer.webhook.request_parser.postmark',
2534+
];
25342535

2535-
foreach ($webhookRequestParsers as $class => $service) {
2536-
8000 $package = substr($service, \strlen('mailer.transport_factory.'));
2536+
foreach ($webhookRequestParsers as $class => $service) {
2537+
$package = substr($service, \strlen('mailer.transport_factory.'));
25372538

2538-
if (!ContainerBuilder::willBeAvailable(sprintf('symfony/%s-mailer', 'gmail' === $package ? 'google' : $package), $class, ['symfony/framework-bundle', 'symfony/mailer'])) {
2539-
$container->removeDefinition($service);
2539+
if (!ContainerBuilder::willBeAvailable(sprintf('symfony/%s-mailer', 'gmail' === $package ? 'google' : $package), $class, ['symfony/framework-bundle', 'symfony/mailer'])) {
2540+
$container->removeDefinition($service);
2541+
}
25402542
}
25412543
}
25422544

0 commit comments

Comments
 (0)
0