Skip to content

Commit 06feca9

Browse files
committed
feature #42426 [Notifier] Autoconfigure chatter.transport_factory (ismail1432)
This PR was merged into the 5.4 branch. Discussion ---------- [Notifier] Autoconfigure chatter.transport_factory | Q | A | ------------- | --- | Branch? | 5.4 | | Bug fix? | no | New feature? | yes | License | MIT | Doc PR | symfony/symfony-docs#... <!-- required for new features --> I'm wondering why we not autoconfigure `chatter.transport_factory` and `texter.transport_factory` with `TransportFactoryInterface`. It will avoid to manually tag the `TransportFactory` Commits ------- d6d012c86a autoconfigure chatter.transport_factory
2 parents ee8a2d5 + 0028294 commit 06feca9

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

DependencyInjection/FrameworkExtension.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@
151151
use Symfony\Component\Notifier\Bridge\Zulip\ZulipTransportFactory;
152152
use Symfony\Component\Notifier\Notifier;
153153
use Symfony\Component\Notifier\Recipient\Recipient;
154+
use Symfony\Component\Notifier\Transport\TransportFactoryInterface as NotifierTransportFactoryInterface;
154155
use Symfony\Component\PropertyAccess\PropertyAccessor;
155156
use Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface;
156157
use Symfony\Component\PropertyInfo\PropertyDescriptionExtractorInterface;
@@ -2428,6 +2429,12 @@ private function registerNotifierConfiguration(array $config, ContainerBuilder $
24282429

24292430
$container->getDefinition('notifier.channel_policy')->setArgument(0, $config['channel_policy']);
24302431

2432+
$container->registerForAutoconfiguration(NotifierTransportFactoryInterface::class)
2433+
->addTag('chatter.transport_factory');
2434+
2435+
$container->registerForAutoconfiguration(NotifierTransportFactoryInterface::class)
2436+
->addTag('texter.transport_factory');
2437+
24312438
$classToServices = [
24322439
AllMySmsTransportFactory::class => 'notifier.transport_factory.allmysms',
24332440
AmazonSnsTransportFactory::class => 'notifier.transport_factory.amazonsns',

0 commit comments

Comments
 (0)