8000 minor #53156 [FrameworkBundle] don't fail when optional dependencies … · symfony/symfony@50606d3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 50606d3

Browse files
committed
minor #53156 [FrameworkBundle] don't fail when optional dependencies are not present (xabbuh)
This PR was merged into the 5.4 branch. Discussion ---------- [FrameworkBundle] don't fail when optional dependencies are not present | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT Commits ------- 123101f don't fail when optional dependencies are not present
2 parents 2d8a41a + 123101f commit 50606d3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2595,8 +2595,8 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
25952595
if (ContainerBuilder::willBeAvailable('symfony/mercure-notifier', MercureTransportFactory::class, $parentPackages, true) && ContainerBuilder::willBeAvailable('symfony/mercure-bundle', MercureBundle::class, $parentPackages, true) && \in_array(MercureBundle::class, $container->getParameter('kernel.bundles'), true)) {
25962596
$container->getDefinition($classToServices[MercureTransportFactory::class])
25972597
->replaceArgument('$registry', new Reference(HubRegistry::class))
2598-
->replaceArgument('$client', new Reference('http_client'))
2599-
->replaceArgument('$dispatcher', new Reference('event_dispatcher'));
2598+
->replaceArgument('$client', new Reference('http_client', ContainerBuilder::NULL_ON_INVALID_REFERENCE))
2599+
->replaceArgument('$dispatcher', new Reference('event_dispatcher', ContainerBuilder::NULL_ON_INVALID_REFERENCE));
26002600
} elseif (ContainerBuilder::willBeAvailable('symfony/mercure-notifier', MercureTransportFactory::class, $parentPackages, true)) {
26012601
$container->removeDefinition($classToServices[MercureTransportFactory::class]);
26022602
}
@@ -2605,16 +2605,16 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
26052605
$container->getDefinition($classToServices[FakeChatTransportFactory::class])
26062606
->replaceArgument('$mailer', new Reference('mailer'))
26072607
->replaceArgument('$logger', new Reference('logger'))
2608-
->replaceArgument('$client', new Reference('http_client'))
2609-
->replaceArgument('$dispatcher', new Reference('event_dispatcher'));
2608+
->replaceArgument('$client', new Reference('http_client', ContainerBuilder::NULL_ON_INVALID_REFERENCE))
2609+
->replaceArgument('$dispatcher', new Reference('event_dispatcher', ContainerBuilder::NULL_ON_INVALID_REFERENCE));
26102610
}
26112611

26122612
if (ContainerBuilder::willBeAvailable('symfony/fake-sms-notifier', FakeSmsTransportFactory::class, ['symfony/framework-bundle', 'symfony/notifier', 'symfony/mailer'], true)) {
26132613
$container->getDefinition($classToServices[FakeSmsTransportFactory::class])
26142614
->replaceArgument('$mailer', new Reference('mailer'))
26152615
->replaceArgument('$logger', new Reference('logger'))
2616-
->replaceArgument('$client', new Reference('http_client'))
2617-
->replaceArgument('$dispatcher', new Reference('event_dispatcher'));
2616+
->replaceArgument('$client', new Reference('http_client', ContainerBuilder::NULL_ON_INVALID_REFERENCE))
2617+
->replaceArgument('$dispatcher', new Reference('event_dispatcher', ContainerBuilder::NULL_ON_INVALID_REFERENCE));
26182618
}
26192619

26202620
if (isset($config['admin_recipients'])) {

0 commit comments

Comments
 (0)
0