Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2073597

Browse filesBrowse 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 ------- d6d012c autoconfigure chatter.transport_factory
2 parents 6f112d9 + d6d012c commit 2073597
Copy full SHA for 2073597

File tree

1 file changed

+7
-0
lines changed
Filter options

1 file changed

+7
-0
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+7Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.