From fcbfbb185c94a6fecabc59194f39ba3982db3445 Mon Sep 17 00:00:00 2001 From: Romain Monteil Date: Fri, 16 Dec 2022 12:03:52 +0100 Subject: [PATCH] [FrameworkBundle] Rename service `notifier.logger_notification_listener` to `notifier.notification_logger_listener` --- UPGRADE-6.3.md | 5 +++++ src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md | 1 + .../Bundle/FrameworkBundle/Resources/config/notifier.php | 6 +++++- .../FrameworkBundle/Resources/config/notifier_debug.php | 2 +- .../FrameworkBundle/Test/NotificationAssertionsTrait.php | 4 ++-- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/UPGRADE-6.3.md b/UPGRADE-6.3.md index b626a000b508f..89caa851669a4 100644 --- a/UPGRADE-6.3.md +++ b/UPGRADE-6.3.md @@ -38,6 +38,11 @@ FrameworkBundle ``` +FrameworkBundle +--------------- + + * Deprecate the `notifier.logger_notification_listener` service, use the `notifier.notification_logger_listener` service instead + HttpKernel ---------- diff --git a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md index 443b2e2792371..b9d859b7a643c 100644 --- a/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md +++ b/src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md @@ -9,6 +9,7 @@ CHANGELOG * Add `--format` option to the `debug:config` command * Add support to pass namespace wildcard in `framework.messenger.routing` * Deprecate `framework:exceptions` tag, unwrap it and replace `framework:exception` tags' `name` attribute by `class` + * Deprecate the `notifier.logger_notification_listener` service, use the `notifier.notification_logger_listener` service instead 6.2 --- diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/notifier.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/notifier.php index 2f53ff03de03d..6ce674148a878 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/notifier.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/notifier.php @@ -126,7 +126,11 @@ ->args([service('texter.transports')]) ->tag('messenger.message_handler', ['handles' => PushMessage::class]) - ->set('notifier.logger_notification_listener', NotificationLoggerListener::class) + ->set('notifier.notification_logger_listener', NotificationLoggerListener::class) ->tag('kernel.event_subscriber') + + ->alias('notifier.logger_notification_listener', 'notifier.notification_logger_listener') + ->deprecate('symfony/framework-bundle', '6.3', 'The "%alias_id%" service is deprecated, use "notifier.notification_logger_listener" instead.') + ; }; diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/notifier_debug.php b/src/Symfony/Bundle/FrameworkBundle/Resources/config/notifier_debug.php index 6147d34e4e7eb..47eab26f936da 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/notifier_debug.php +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/notifier_debug.php @@ -16,7 +16,7 @@ return static function (ContainerConfigurator $container) { $container->services() ->set('notifier.data_collector', NotificationDataCollector::class) - ->args([service('notifier.logger_notification_listener')]) + ->args([service('notifier.notification_logger_listener')]) ->tag('data_collector', ['template' => '@WebProfiler/Collector/notifier.html.twig', 'id' => 'notifier']) ; }; diff --git a/src/Symfony/Bundle/FrameworkBundle/Test/NotificationAssertionsTrait.php b/src/Symfony/Bundle/FrameworkBundle/Test/NotificationAssertionsTrait.php index 163c2a9719c55..30298ef04c54f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Test/NotificationAssertionsTrait.php +++ b/src/Symfony/Bundle/FrameworkBundle/Test/NotificationAssertionsTrait.php @@ -91,8 +91,8 @@ public static function getNotifierMessage(int $index = 0, string $transportName public static function getNotificationEvents(): NotificationEvents { $container = static::getContainer(); - if ($container->has('notifier.logger_notification_listener')) { - return $container->get('notifier.logger_notification_listener')->getEvents(); + if ($container->has('notifier.notification_logger_listener')) { + return $container->get('notifier.notification_logger_listener')->getEvents(); } static::fail('A client must have Notifier enabled to make notifications assertions. Did you forget to require symfony/notifier?');