@@ -2812,8 +2812,6 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
2812
2812
NotifierBridge \Engagespot \EngagespotTransportFactory::class => 'notifier.transport_factory.engagespot ' ,
2813
2813
NotifierBridge \Esendex \EsendexTransportFactory::class => 'notifier.transport_factory.esendex ' ,
2814
2814
NotifierBridge \Expo \ExpoTransportFactory::class => 'notifier.transport_factory.expo ' ,
2815
- NotifierBridge \FakeChat \FakeChatTransportFactory::class => 'notifier.transport_factory.fake-chat ' ,
2816
- NotifierBridge \FakeSms \FakeSmsTransportFactory::class => 'notifier.transport_factory.fake-sms ' ,
2817
2815
NotifierBridge \Firebase \FirebaseTransportFactory::class => 'notifier.transport_factory.firebase ' ,
2818
2816
NotifierBridge \FortySixElks \FortySixElksTransportFactory::class => 'notifier.transport_factory.forty-six-elks ' ,
2819
2817
NotifierBridge \FreeMobile \FreeMobileTransportFactory::class => 'notifier.transport_factory.free-mobile ' ,
@@ -2891,20 +2889,26 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
2891
2889
$ container ->removeDefinition ($ classToServices [NotifierBridge \Mercure \MercureTransportFactory::class]);
2892
2890
}
2893
2891
2894
- if (ContainerBuilder::willBeAvailable ('symfony/fake-chat-notifier ' , NotifierBridge \FakeChat \FakeChatTransportFactory::class, ['symfony/framework-bundle ' , 'symfony/notifier ' , 'symfony/mailer ' ])) {
2895
- $ container ->getDefinition ($ classToServices [NotifierBridge \FakeChat \FakeChatTransportFactory::class])
2892
+ // don't use ContainerBuilder::willBeAvailable() as these are not needed in production
2893
+ if (class_exists (NotifierBridge \FakeChat \FakeChatTransportFactory::class)) {
2894
+ $ container ->getDefinition ('notifier.transport_factory.fake-chat ' )
2896
2895
->replaceArgument (0 , new Reference ('mailer ' ))
2897
2896
->replaceArgument (1 , new Reference ('logger ' ))
2898
2897
->addArgument (new Reference ('event_dispatcher ' , ContainerBuilder::NULL_ON_INVALID_REFERENCE ))
2899
2898
->addArgument (new Reference ('http_client ' , ContainerBuilder::NULL_ON_INVALID_REFERENCE ));
2899
+ } else {
2900
+ $ container ->removeDefinition ('notifier.transport_factory.fake-chat ' );
2900
2901
}
2901
2902
2902
- if (ContainerBuilder::willBeAvailable ('symfony/fake-sms-notifier ' , NotifierBridge \FakeSms \FakeSmsTransportFactory::class, ['symfony/framework-bundle ' , 'symfony/notifier ' , 'symfony/mailer ' ])) {
2903
- $ container ->getDefinition ($ classToServices [NotifierBridge \FakeSms \FakeSmsTransportFactory::class])
2903
+ // don't use ContainerBuilder::willBeAvailable() as these are not needed in production
2904
+ if (class_exists (NotifierBridge \FakeSms \FakeSmsTransportFactory::class)) {
2905
+ $ container ->getDefinition ('notifier.transport_factory.fake-sms ' )
2904
2906
->replaceArgument (0 , new Reference ('mailer ' ))
2905
2907
->replaceArgument (1 , new Reference ('logger ' ))
2906
2908
->addArgument (new Reference ('event_dispatcher ' , ContainerBuilder::NULL_ON_INVALID_REFERENCE ))
2907
2909
->addArgument (new Reference ('http_client ' , ContainerBuilder::NULL_ON_INVALID_REFERENCE ));
2910
+ } else {
2911
+ $ container ->removeDefinition ('notifier.transport_factory.fake-sms ' );
2908
2912
}
2909
2913
2910
2914
if (isset ($ config ['admin_recipients ' ])) {
0 commit comments