Skip to content
Permalink
Browse files

feature #33687 Notifier Component (fabpot)

This PR was merged into the 5.0-dev branch.

Discussion
----------

Notifier Component

| Q             | A
| ------------- | ---
| Branch?       | 5.0
| Bug fix?      | no
| New feature?  | yes <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets       |
| License       | MIT
| Doc PR        | not yet

Initial PR for the Notifier component. Tests missing for now.

Commits
-------

7f97a3f [Notifier] added the component
  • Loading branch information...
nicolas-grekas committed Oct 5, 2019
2 parents d2f8199 + 7f97a3f commit 8375c6be4bd0a8e46bd1e53caccf8c5398e9ad37
Showing with 4,544 additions and 0 deletions.
  1. +1 −0 composer.json
  2. +79 −0 src/Symfony/Bridge/Monolog/Handler/NotifierHandler.php
  3. +48 −0 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
  4. +71 −0 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
  5. +94 −0 src/Symfony/Bundle/FrameworkBundle/Resources/config/notifier.xml
  6. +33 −0 src/Symfony/Bundle/FrameworkBundle/Resources/config/notifier_transports.xml
  7. +8 −0 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php
  8. +2 −0 src/Symfony/Component/Notifier/.gitattributes
  9. +3 −0 src/Symfony/Component/Notifier/.gitignore
  10. +2 −0 src/Symfony/Component/Notifier/Bridge/Nexmo/.gitattributes
  11. +7 −0 src/Symfony/Component/Notifier/Bridge/Nexmo/CHANGELOG.md
  12. +19 −0 src/Symfony/Component/Notifier/Bridge/Nexmo/LICENSE
  13. +77 −0 src/Symfony/Component/Notifier/Bridge/Nexmo/NexmoTransport.php
  14. +46 −0 src/Symfony/Component/Notifier/Bridge/Nexmo/NexmoTransportFactory.php
  15. +12 −0 src/Symfony/Component/Notifier/Bridge/Nexmo/README.md
  16. +35 −0 src/Symfony/Component/Notifier/Bridge/Nexmo/composer.json
  17. +31 −0 src/Symfony/Component/Notifier/Bridge/Nexmo/phpunit.xml.dist
  18. +2 −0 src/Symfony/Component/Notifier/Bridge/Slack/.gitattributes
  19. +25 −0 src/Symfony/Component/Notifier/Bridge/Slack/Block/AbstractSlackBlock.php
  20. +25 −0 src/Symfony/Component/Notifier/Bridge/Slack/Block/AbstractSlackBlockElement.php
  21. +20 −0 src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackBlockElementInterface.php
  22. +20 −0 src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackBlockInterface.php
  23. +23 −0 src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackDividerBlock.php
  24. +27 −0 src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackImageBlock.php
  25. +27 −0 src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackImageBlockElement.php
  26. +46 −0 src/Symfony/Component/Notifier/Bridge/Slack/Block/SlackSectionBlock.php
  27. +7 −0 src/Symfony/Component/Notifier/Bridge/Slack/CHANGELOG.md
  28. +19 −0 src/Symfony/Component/Notifier/Bridge/Slack/LICENSE
  29. +12 −0 src/Symfony/Component/Notifier/Bridge/Slack/README.md
  30. +176 −0 src/Symfony/Component/Notifier/Bridge/Slack/SlackOptions.php
  31. +90 −0 src/Symfony/Component/Notifier/Bridge/Slack/SlackTransport.php
  32. +45 −0 src/Symfony/Component/Notifier/Bridge/Slack/SlackTransportFactory.php
  33. +35 −0 src/Symfony/Component/Notifier/Bridge/Slack/composer.json
  34. +31 −0 src/Symfony/Component/Notifier/Bridge/Slack/phpunit.xml.dist
  35. +2 −0 src/Symfony/Component/Notifier/Bridge/Telegram/.gitattributes
  36. +7 −0 src/Symfony/Component/Notifier/Bridge/Telegram/CHANGELOG.md
  37. +19 −0 src/Symfony/Component/Notifier/Bridge/Telegram/LICENSE
  38. +12 −0 src/Symfony/Component/Notifier/Bridge/Telegram/README.md
  39. +86 −0 src/Symfony/Component/Notifier/Bridge/Telegram/TelegramTransport.php
  40. +45 −0 src/Symfony/Component/Notifier/Bridge/Telegram/TelegramTransportFactory.php
  41. +35 −0 src/Symfony/Component/Notifier/Bridge/Telegram/composer.json
  42. +31 −0 src/Symfony/Component/Notifier/Bridge/Telegram/phpunit.xml.dist
  43. +2 −0 src/Symfony/Component/Notifier/Bridge/Twilio/.gitattributes
  44. +7 −0 src/Symfony/Component/Notifier/Bridge/Twilio/CHANGELOG.md
  45. +19 −0 src/Symfony/Component/Notifier/Bridge/Twilio/LICENSE
  46. +12 −0 src/Symfony/Component/Notifier/Bridge/Twilio/README.md
  47. +76 −0 src/Symfony/Component/Notifier/Bridge/Twilio/TwilioTransport.php
  48. +46 −0 src/Symfony/Component/Notifier/Bridge/Twilio/TwilioTransportFactory.php
  49. +35 −0 src/Symfony/Component/Notifier/Bridge/Twilio/composer.json
  50. +31 −0 src/Symfony/Component/Notifier/Bridge/Twilio/phpunit.xml.dist
  51. +7 −0 src/Symfony/Component/Notifier/CHANGELOG.md
  52. +37 −0 src/Symfony/Component/Notifier/Channel/AbstractChannel.php
  53. +50 −0 src/Symfony/Component/Notifier/Channel/BrowserChannel.php
  54. +27 −0 src/Symfony/Component/Notifier/Channel/ChannelInterface.php
  55. +38 −0 src/Symfony/Component/Notifier/Channel/ChannelPolicy.php
  56. +25 −0 src/Symfony/Component/Notifier/Channel/ChannelPolicyInterface.php
  57. +55 −0 src/Symfony/Component/Notifier/Channel/ChatChannel.php
  58. +91 −0 src/Symfony/Component/Notifier/Channel/EmailChannel.php
  59. +53 −0 src/Symfony/Component/Notifier/Channel/SmsChannel.php
  60. +63 −0 src/Symfony/Component/Notifier/Chatter.php
  61. +25 −0 src/Symfony/Component/Notifier/ChatterInterface.php
  62. +62 −0 src/Symfony/Component/Notifier/DataCollector/NotificationDataCollector.php
  63. +42 −0 src/Symfony/Component/Notifier/Event/MessageEvent.php
  64. +69 −0 src/Symfony/Component/Notifier/Event/NotificationEvents.php
  65. +57 −0 src/Symfony/Component/Notifier/EventListener/NotificationLoggerListener.php
  66. +58 −0 src/Symfony/Component/Notifier/EventListener/SendFailedMessageToNotifierListener.php
  67. +23 −0 src/Symfony/Component/Notifier/Exception/ExceptionInterface.php
  68. +21 −0 src/Symfony/Component/Notifier/Exception/IncompleteDsnException.php
  69. +21 −0 src/Symfony/Component/Notifier/Exception/InvalidArgumentException.php
  70. +21 −0 src/Symfony/Component/Notifier/Exception/LogicException.php
  71. +21 −0 src/Symfony/Component/Notifier/Exception/RuntimeException.php
  72. +43 −0 src/Symfony/Component/Notifier/Exception/TransportException.php
  73. +22 −0 src/Symfony/Component/Notifier/Exception/TransportExceptionInterface.php
  74. +63 −0 src/Symfony/Component/Notifier/Exception/UnsupportedSchemeException.php
  75. +19 −0 src/Symfony/Component/Notifier/LICENSE
  76. +97 −0 src/Symfony/Component/Notifier/Message/ChatMessage.php
  77. +115 −0 src/Symfony/Component/Notifier/Message/EmailMessage.php
  78. +28 −0 src/Symfony/Component/Notifier/Message/MessageInterface.php
  79. +24 −0 src/Symfony/Component/Notifier/Message/MessageOptionsInterface.php
  80. +100 −0 src/Symfony/Component/Notifier/Message/SmsMessage.php
  81. +35 −0 src/Symfony/Component/Notifier/Messenger/MessageHandler.php
  82. +25 −0 src/Symfony/Component/Notifier/Notification/ChatNotificationInterface.php
  83. +25 −0 src/Symfony/Component/Notifier/Notification/EmailNotificationInterface.php
  84. +203 −0 src/Symfony/Component/Notifier/Notification/Notification.php
  85. +25 −0 src/Symfony/Component/Notifier/Notification/SmsNotificationInterface.php
  86. +106 −0 src/Symfony/Component/Notifier/Notifier.php
  87. +27 −0 src/Symfony/Component/Notifier/NotifierInterface.php
  88. +18 −0 src/Symfony/Component/Notifier/README.md
  89. +44 −0 src/Symfony/Component/Notifier/Recipient/AdminRecipient.php
  90. +25 −0 src/Symfony/Component/Notifier/Recipient/NoRecipient.php
  91. +42 −0 src/Symfony/Component/Notifier/Recipient/Recipient.php
  92. +29 −0 src/Symfony/Component/Notifier/Recipient/SmsRecipientInterface.php
  93. +63 −0 src/Symfony/Component/Notifier/Texter.php
  94. +25 −0 src/Symfony/Component/Notifier/TexterInterface.php
  95. +129 −0 src/Symfony/Component/Notifier/Transport.php
  96. +91 −0 src/Symfony/Component/Notifier/Transport/AbstractTransport.php
  97. +63 −0 src/Symfony/Component/Notifier/Transport/AbstractTransportFactory.php
  98. +91 −0 src/Symfony/Component/Notifier/Transport/Dsn.php
  99. +40 −0 src/Symfony/Component/Notifier/Transport/FailoverTransport.php
  100. +36 −0 src/Symfony/Component/Notifier/Transport/NullTransport.php
  101. +36 −0 src/Symfony/Component/Notifier/Transport/NullTransportFactory.php
  102. +128 −0 src/Symfony/Component/Notifier/Transport/RoundRobinTransport.php
  103. +31 −0 src/Symfony/Component/Notifier/Transport/TransportFactoryInterface.php
  104. +32 −0 src/Symfony/Component/Notifier/Transport/TransportInterface.php
  105. +71 −0 src/Symfony/Component/Notifier/Transport/Transports.php
  106. +33 −0 src/Symfony/Component/Notifier/composer.json
  107. +31 −0 src/Symfony/Component/Notifier/phpunit.xml.dist
@@ -69,6 +69,7 @@
"symfony/messenger": "self.version",
"symfony/mime": "self.version",
"symfony/monolog-bridge": "self.version",
"symfony/notifier": "self.version",
"symfony/options-resolver": "self.version",
"symfony/postmark-mailer": "self.version",
"symfony/process": "self.version",
@@ -0,0 +1,79 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bridge\Monolog\Handler;
use Monolog\Handler\AbstractHandler;
use Monolog\Logger;
use Symfony\Component\Notifier\Notification\Notification;
use Symfony\Component\Notifier\Notifier;
use Symfony\Component\Notifier\NotifierInterface;
/**
* Uses Notifier as a log handler.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class NotifierHandler extends AbstractHandler
{
private $notifier;
public function __construct(NotifierInterface $notifier, int $level = Logger::ERROR, bool $bubble = true)
{
$this->notifier = $notifier;
parent::__construct($level < Logger::ERROR ? Logger::ERROR : $level, $bubble);
}
public function handle(array $record): bool
{
if (!$this->isHandling($record)) {
return false;
}
$this->notify([$record]);
return !$this->bubble;
}
public function handleBatch(array $records): void
{
if ($records = array_filter($records, [$this, 'isHandling'])) {
$this->notify($records);
}
}
private function notify(array $records): void
{
$record = $this->getHighestRecord($records);
if (($record['context']['exception'] ?? null) instanceof \Throwable) {
$notification = Notification::fromThrowable($record['context']['exception']);
} else {
$notification = new Notification($record['message']);
}
$notification->importanceFromLogLevelName(Logger::getLevelName($record['level']));
$this->notifier->send($notification, ...$this->notifier->getAdminRecipients());
}
private function getHighestRecord(array $records)
{
$highestRecord = null;
foreach ($records as $record) {
if (null === $highestRecord || $highestRecord['level'] < $record['level']) {
$highestRecord = $record;
}
}
return $highestRecord;
}
}
@@ -27,6 +27,7 @@
use Symfony\Component\Lock\Store\SemaphoreStore;
use Symfony\Component\Mailer\Mailer;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Notifier\Notifier;
use Symfony\Component\PropertyInfo\PropertyInfoExtractorInterface;
use Symfony\Component\Serializer\Serializer;
use Symfony\Component\Translation\Translator;
@@ -114,6 +115,7 @@ public function getConfigTreeBuilder()
$this->addRobotsIndexSection($rootNode);
$this->addHttpClientSection($rootNode);
$this->addMailerSection($rootNode);
$this->addNotifierSection($rootNode);
return $treeBuilder;
}
@@ -1475,4 +1477,50 @@ private function addMailerSection(ArrayNodeDefinition $rootNode)
->end()
;
}
private function addNotifierSection(ArrayNodeDefinition $rootNode)
{
$rootNode
->children()
->arrayNode('notifier')
->info('Notifier configuration')
->{!class_exists(FullStack::class) && class_exists(Notifier::class) ? 'canBeDisabled' : 'canBeEnabled'}()
->fixXmlConfig('chatter_transport')
->children()
->arrayNode('chatter_transports')
->useAttributeAsKey('name')
->prototype('scalar')->end()
->end()
->end()
->fixXmlConfig('texter_transport')
->children()
->arrayNode('texter_transports')
->useAttributeAsKey('name')
->prototype('scalar')->end()
->end()
->end()
->children()
->arrayNode('channel_policy')
->useAttributeAsKey('name')
->prototype('array')
->beforeNormalization()->ifString()->then(function (string $v) { return [$v]; })->end()
->prototype('scalar')->end()
->end()
->end()
->end()
->fixXmlConfig('admin_recipient')
->children()
->arrayNode('admin_recipients')
->prototype('array')
->children()
->scalarNode('email')->cannotBeEmpty()->end()
->scalarNode('phone')->defaultNull()->end()
->end()
->end()
->end()
->end()
->end()
->end()
;
}
}
@@ -89,6 +89,12 @@
use Symfony\Component\Messenger\Transport\TransportInterface;
use Symfony\Component\Mime\MimeTypeGuesserInterface;
use Symfony\Component\Mime\MimeTypes;
use Symfony\Component\Notifier\Bridge\Nexmo\NexmoTransportFactory;
use Symfony\Component\Notifier\Bridge\Slack\SlackTransportFactory;
use Symfony\Component\Notifier\Bridge\Telegram\TelegramTransportFactory;
use Symfony\Component\Notifier\Bridge\Twilio\TwilioTransportFactory;
use Symfony\Component\Notifier\Notifier;
use Symfony\Component\Notifier\Recipient\AdminRecipient;
use Symfony\Component\PropertyAccess\PropertyAccessor;
use Symfony\Component\PropertyInfo\PropertyAccessExtractorInterface;
use Symfony\Component\PropertyInfo\PropertyDescriptionExtractorInterface;
@@ -313,6 +319,10 @@ public function load(array $configs, ContainerBuilder $container)
$this->registerMailerConfiguration($config['mailer'], $container, $loader);
}
if ($this->isConfigEnabled($container, $config['notifier'])) {
$this->registerNotifierConfiguration($config['notifier'], $container, $loader);
}
$propertyInfoEnabled = $this->isConfigEnabled($container, $config['property_info']);
$this->registerValidationConfiguration($config['validation'], $container, $loader, $propertyInfoEnabled);
$this->registerEsiConfiguration($config['esi'], $container, $loader);
@@ -1864,6 +1874,67 @@ private function registerMailerConfiguration(array $config, ContainerBuilder $co
$envelopeListener->setArgument(1, $recipients);
}
private function registerNotifierConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)
{
if (!class_exists(Notifier::class)) {
throw new LogicException('Notifier support cannot be enabled as the component is not installed. Try running "composer require symfony/notifier".');
}
$loader->load('notifier.xml');
$loader->load('notifier_transports.xml');
if ($config['chatter_transports']) {
$container->getDefinition('chatter.transports')->setArgument(0, $config['chatter_transports']);
} else {
$container->removeDefinition('chatter');
}
if ($config['texter_transports']) {
$container->getDefinition('texter.transports')->setArgument(0, $config['texter_transports']);
} else {
$container->removeDefinition('texter');
}
if ($this->mailerConfigEnabled) {
$sender = $container->getDefinition('mailer.envelope_listener')->getArgument(0);
$container->getDefinition('notifier.channel.email')->setArgument(2, $sender);
} else {
$container->removeDefinition('notifier.channel.email');
}
if (!$this->messengerConfigEnabled) {
$container->removeDefinition('notifier.failed_message_listener');
} else {
// as we have a bus, the channels don't need the transports
$container->getDefinition('notifier.channel.chat')->setArgument(0, null);
$container->getDefinition('notifier.channel.email')->setArgument(0, null);
$container->getDefinition('notifier.channel.sms')->setArgument(0, null);
}
$container->getDefinition('notifier.channel_policy')->setArgument(0, $config['channel_policy']);
$classToServices = [
SlackTransportFactory::class => 'notifier.transport_factory.slack',
TelegramTransportFactory::class => 'notifier.transport_factory.telegram',
NexmoTransportFactory::class => 'notifier.transport_factory.nexmo',
TwilioTransportFactory::class => 'notifier.transport_factory.twilio',
];
foreach ($classToServices as $class => $service) {
if (!class_exists($class)) {
$container->removeDefinition($service);
}
}
if (isset($config['admin_recipients'])) {
$notifier = $container->getDefinition('notifier');
foreach ($config['admin_recipients'] as $i => $recipient) {
$id = 'notifier.admin_recipient.'.$i;
$container->setDefinition($id, new Definition(AdminRecipient::class, [$recipient['email'], $recipient['phone']]));
$notifier->addMethodCall('addAdminRecipient', [new Reference($id)]);
}
}
}
/**
* {@inheritdoc}
*/
@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8" ?>

<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<services>
<service id="notifier" class="Symfony\Component\Notifier\Notifier">
<argument type="tagged_locator" tag="notifier.channel" index-by="channel" />
<argument type="service" id="notifier.channel_policy" on-invalid="ignore" />
</service>
<service id="Symfony\Component\Notifier\NotifierInterface" alias="notifier" />

<service id="notifier.channel_policy" class="Symfony\Component\Notifier\Channel\ChannelPolicy">
<argument type="collection" /> <!-- policy -->
</service>

<service id="notifier.channel.browser" class="Symfony\Component\Notifier\Channel\BrowserChannel">
<argument type="service" id="request_stack" />
<tag name="notifier.channel" channel="browser" />
</service>

<service id="notifier.channel.chat" class="Symfony\Component\Notifier\Channel\ChatChannel">
<argument type="service" id="chatter.transports" />
<argument type="service" id="messenger.default_bus" on-invalid="ignore" />
<tag name="notifier.channel" channel="chat" />
</service>

<service id="notifier.channel.sms" class="Symfony\Component\Notifier\Channel\SmsChannel">
<argument type="service" id="texter.transports" />
<argument type="service" id="messenger.default_bus" on-invalid="ignore" />
<tag name="notifier.channel" channel="sms" />
</service>

<service id="notifier.channel.email" class="Symfony\Component\Notifier\Channel\EmailChannel">
<argument type="service" id="mailer.transports" />
<argument type="service" id="messenger.default_bus" on-invalid="ignore" />
<tag name="notifier.channel" channel="email" />
</service>

<service id="notifier.monolog_handler" class="Symfony\Bridge\Monolog\Handler\NotifierHandler">
<argument type="service" id="notifier" />
</service>

<service id="notifier.failed_message_listener" class="Symfony\Component\Notifier\EventListener\SendFailedMessageToNotifierListener">
<argument type="service" id="notifier" />
<tag name="kernel.event_subscriber" />
</service>

<!-- chatter -->
<service id="chatter" class="Symfony\Component\Notifier\Chatter">
<argument type="service" id="chatter.transports" />
<argument type="service" id="messenger.default_bus" on-invalid="ignore" />
<argument type="service" id="event_dispatcher" on-invalid="ignore" />
</service>
<service id="Symfony\Component\Notifier\ChatterInterface" alias="chatter" />

<service id="chatter.transports" class="Symfony\Component\Notifier\Transport\Transports">
<factory service="chatter.transport_factory" method="fromStrings" />
<argument type="collection" /> <!-- transports -->
</service>

<service id="chatter.transport_factory" class="Symfony\Component\Notifier\Transport">
<argument type="tagged_iterator" tag="chatter.transport_factory" />
</service>

<service id="chatter.messenger.chat_handler" class="Symfony\Component\Notifier\Messenger\MessageHandler">
<argument type="service" id="chatter.transports" />
<tag name="messenger.message_handler" handles="Symfony\Component\Notifier\Message\ChatMessage" />
</service>

<!-- texter -->
<service id="texter" class="Symfony\Component\Notifier\Texter">
<argument type="service" id="texter.transports" />
<argument type="service" id="messenger.default_bus" on-invalid="ignore" />
<argument type="service" id="event_dispatcher" on-invalid="ignore" />
</service>
<service id="Symfony\Component\Notifier\TexterInterface" alias="texter" />

<service id="texter.transports" class="Symfony\Component\Notifier\Transport\Transports">
<factory service="texter.transport_factory" method="fromStrings" />
<argument type="collection" /> <!-- transports -->
</service>

<service id="texter.transport_factory" class="Symfony\Component\Notifier\Transport">
<argument type="tagged_iterator" tag="texter.transport_factory" />
</service>

<service id="texter.messenger.sms_handler" class="Symfony\Component\Notifier\Messenger\MessageHandler">
<argument type="service" id="texter.transports" />
<tag name="messenger.message_handler" handles="Symfony\Component\Notifier\Message\SmsMessage" />
</service>
</services>
</container>
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8" ?>

<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<services>
<service id="notifier.transport_factory.abstract" class="Symfony\Component\Notifier\Transport\AbstractTransportFactory" abstract="true">
<argument type="service" id="event_dispatcher" />
<argument type="service" id="http_client" on-invalid="ignore" />
</service>

<service id="notifier.transport_factory.slack" class="Symfony\Component\Notifier\Bridge\Slack\SlackTransportFactory" parent="notifier.transport_factory.abstract">
<tag name="chatter.transport_factory" />
</service>

<service id="notifier.transport_factory.telegram" class="Symfony\Component\Notifier\Bridge\Telegram\TelegramTransportFactory" parent="notifier.transport_factory.abstract">
<tag name="chatter.transport_factory" />
</service>

<service id="notifier.transport_factory.nexmo" class="Symfony\Component\Notifier\Bridge\Nexmo\NexmoTransportFactory" parent="notifier.transport_factory.abstract">
<tag name="texter.transport_factory" />
</service>

<service id="notifier.transport_factory.twilio" class="Symfony\Component\Notifier\Bridge\Twilio\TwilioTransportFactory" parent="notifier.transport_factory.abstract">
<tag name="texter.transport_factory" />
</service>

<service id="notifier.transport_factory.null" class="Symfony\Component\Notifier\Transport\NullTransportFactory" parent="notifier.transport_factory.abstract">
<tag name="notifier.transport_factory" />
</service>
</services>
</container>
@@ -21,6 +21,7 @@
use Symfony\Component\Lock\Store\SemaphoreStore;
use Symfony\Component\Mailer\Mailer;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Notifier\Notifier;
class ConfigurationTest extends TestCase
{
@@ -411,6 +412,13 @@ class_exists(SemaphoreStore::class) && SemaphoreStore::isSupported() ? 'semaphor
'transports' => [],
'enabled' => !class_exists(FullStack::class) && class_exists(Mailer::class),
],
'notifier' => [
'enabled' => !class_exists(FullStack::class) && class_exists(Notifier::class),
'chatter_transports' => [],
'texter_transports' => [],
'channel_policy' => [],
'admin_recipients' => [],
],
'error_controller' => 'error_controller',
];
}

0 comments on commit 8375c6b

Please sign in to comment.
You can’t perform that action at this time.