Skip to content

Navigation Menu

Sign in
Appearance settings

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 dc50758

Browse filesBrowse files
committed
#30670 - Changing messenger bus tag from 'message_bus' to 'messenger.message_bus'
1 parent f806e68 commit dc50758
Copy full SHA for dc50758

File tree

5 files changed

+9
-9
lines changed
Filter options

5 files changed

+9
-9
lines changed

‎src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static function getSubscribedServices()
8787
'security.token_storage' => '?'.TokenStorageInterface::class,
8888
'security.csrf.token_manager' => '?'.CsrfTokenManagerInterface::class,
8989
'parameter_bag' => '?'.ContainerBagInterface::class,
90-
'message_bus' => '?'.MessageBusInterface::class,
90+
'messenger.message_bus' => '?'.MessageBusInterface::class,
9191
];
9292
}
9393
}

‎src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Controller/ControllerTrait.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,12 +403,12 @@ protected function isCsrfTokenValid(string $id, ?string $token): bool
403403
*/
404404
protected function dispatchMessage($message): Envelope
405405
{
406-
if (!$this->container->has('message_bus')) {
406+
if (!$this->container->has('messenger.message_bus')) {
407407
$message = class_exists(Envelope::class) ? 'You need to define the "messenger.default_bus" configuration option.' : 'Try running "composer require symfony/messenger".';
408408
throw new \LogicException('The message bus is not enabled in your application. '.$message);
409409
}
410410

411-
return $this->container->get('message_bus')->dispatch($message);
411+
return $this->container->get('messenger.message_bus')->dispatch($message);
412412
}
413413

414414
/**

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

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,7 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
16551655
$container->register($busId, MessageBus::class)->addArgument([])->addTag('messenger.bus');
16561656

16571657
if ($busId === $config['default_bus']) {
1658-
$container->setAlias('message_bus', $busId)->setPublic(true);
1658+
$container->setAlias('messenger.message_bus', $busId)->setPublic(true);
16591659
$container->setAlias(MessageBusInterface::class, $busId);
16601660
} else {
16611661
$container->registerAliasForArgument($busId, MessageBusInterface::class);

‎src/Symfony/Bundle/FrameworkBundle/Tests/Controller/AbstractControllerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/Controller/AbstractControllerTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testSubscribedServices()
4242
'doctrine' => '?Doctrine\\Common\\Persistence\\ManagerRegistry',
4343
'form.factory' => '?Symfony\\Component\\Form\\FormFactoryInterface',
4444
'parameter_bag' => '?Symfony\\Component\\DependencyInjection\\ParameterBag\\ContainerBagInterface',
45-
'message_bus' => '?Symfony\\Component\\Messenger\\MessageBusInterface',
45+
'messenger.message_bus' => '?Symfony\\Component\\Messenger\\MessageBusInterface',
4646
'security.token_storage' => '?Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorageInterface',
4747
'security.csrf.token_manager' => '?Symfony\\Component\\Security\\Csrf\\CsrfTokenManagerInterface',
4848
];

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,8 @@ public function testWebLink()
646646
public function testMessenger()
647647
{
648648
$container = $this->createContainerFromFile('messenger');
649-
$this->assertTrue($container->hasAlias('message_bus'));
650-
$this->assertTrue($container->getAlias('message_bus')->isPublic());
649+
$this->assertTrue($container->hasAlias('messenger.message_bus'));
650+
$this->assertTrue($container->getAlias('messenger.message_bus')->isPublic());
651651
$this->assertFalse($container->hasDefinition('messenger.transport.amqp.factory'));
652652
$this->assertTrue($container->hasDefinition('messenger.transport_factory'));
653653
$this->assertSame(TransportFactory::class, $container->getDefinition('messenger.transport_factory')->getClass());
@@ -748,8 +748,8 @@ public function testMessengerWithMultipleBuses()
748748
['id' => 'handle_message', 'arguments' => []],
749749
], $container->getParameter('messenger.bus.queries.middleware'));
750750

751-
$this->assertTrue($container->hasAlias('message_bus'));
752-
$this->assertSame('messenger.bus.commands', (string) $container->getAlias('message_bus'));
751+
$this->assertTrue($container->hasAlias('messenger.message_bus'));
752+
$this->assertSame('messenger.bus.commands', (string) $container->getAlias('messenger.message_bus'));
753753
}
754754

755755
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.