Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 16fa082

Browse files
committed
[FrameworkBundle] Rename service notifier.logger_notification_listener to notifier.notification_logger_listener
1 parent 071bddb commit 16fa082

File tree

6 files changed

+23
-1
lines changed

6 files changed

+23
-1
lines changed

UPGRADE-6.3.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ FrameworkBundle
3838
</framework:config>
3939
```
4040

41+
FrameworkBundle
42+
---------------
43+
44+
* Deprecate the `notifier.logger_notification_listener` service, use the `notifier.notification_logger_listener` service instead
45+
4146
HttpKernel
4247
----------
4348

src/Symfony/Bundle/FrameworkBundle/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ CHANGELOG
99
* Add `--format` option to the `debug:config` command
1010
* Add support to pass namespace wildcard in `framework.messenger.routing`
1111
* Deprecate `framework:exceptions` tag, unwrap it and replace `framework:exception` tags' `name` attribute by `class`
12+
* Deprecate the `notifier.logger_notification_listener` service, use the `notifier.notification_logger_listener` service instead
1213

1314
6.2
1415
---

src/Symfony/Bundle/FrameworkBundle/Resources/config/notifier.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,5 +128,9 @@
128128

129129
->set('notifier.logger_notification_listener', NotificationLoggerListener::class)
130130
->tag('kernel.event_subscriber')
131+
->deprecate('symfony/framework-bundle', '6.3', 'The "%service_id%" service is deprecated, use "notifier.notification_logger_listener" instead.')
132+
133+
->set('notifier.notification_logger_listener', NotificationLoggerListener::class)
134+
->tag('kernel.event_subscriber')
131135
;
132136
};

src/Symfony/Bundle/FrameworkBundle/Resources/config/notifier_debug.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
return static function (ContainerConfigurator $container) {
1717
$container->services()
1818
->set('notifier.data_collector', NotificationDataCollector::class)
19-
->args([service('notifier.logger_notification_listener')])
19+
->args([service('notifier.notification_logger_listener')])
2020
->tag('data_collector', ['template' => '@WebProfiler/Collector/notifier.html.twig', 'id' => 'notifier'])
2121
;
2222
};

src/Symfony/Bundle/FrameworkBundle/Test/NotificationAssertionsTrait.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ public static function getNotifierMessage(int $index = 0, string $transportName
9191
public static function getNotificationEvents(): NotificationEvents
9292
{
9393
$container = static::getContainer();
94+
if ($container->has('notifier.notification_logger_listener')) {
95+
return $container->get('notifier.notification_logger_listener')->getEvents();
96+
}
97+
9498
if ($container->has('notifier.logger_notification_listener')) {
9599
return $container->get('notifier.logger_notification_listener')->getEvents();
96100
}

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/NotificationTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,21 @@
1111

1212
namespace Symfony\Bundle\FrameworkBundle\Tests\Functional;
1313

14+
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait;
15+
1416
final class NotificationTest extends AbstractWebTestCase
1517
{
18+
use ExpectDeprecationTrait;
19+
1620
/**
1721
* @requires function \Symfony\Bundle\MercureBundle\MercureBundle::build
22+
*
23+
* @group legacy
1824
*/
1925
public function testNotifierAssertion()
2026
{
27+
$this->expectDeprecation('Since symfony/framework-bundle 6.3: The "notifier.logger_notification_listener" service is deprecated, use "notifier.notification_logger_listener" instead.');
28+
2129
$client = $this->createClient(['test_case' => 'Notifier', 'root_config' => 'config.yml', 'debug' => true]);
2230
$client->request('GET', '/send_notification');
2331

0 commit comments

Comments
 (0)