Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commita38953b

Browse files
committed
[Messenger][FrameworkBundle] Fix xml configuration of messenger routing
1 parent5440d67 commita38953b

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,7 @@ private function addMessengerSection(ArrayNodeDefinition $rootNode)
11471147
->ifTrue(function ($v) {returnisset($v['buses']) &&\count($v['buses']) >1 &&null ===$v['default_bus']; })
11481148
->thenInvalid('You must specify the "default_bus" if you define more than one bus.')
11491149
->end()
1150+
->fixXmlConfig('routing','routing')
11501151
->children()
11511152
->arrayNode('routing')
11521153
->normalizeKeys(false)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@ private function registerMessengerConfiguration(array $config, ContainerBuilder
17931793
// make sure senderAliases contains all senders
17941794
foreach ($messageConfiguration['senders']as$sender) {
17951795
if (!isset($senderReferences[$sender])) {
1796-
thrownewLogicException(sprintf('Invalid Messenger routing configuration: the "%s" class is being routed to a sender called "%s". This is not a valid transport or serviceid.',$message,$sender));
1796+
thrownewLogicException(sprintf('Invalid Messenger routing configuration: the "%s" class is being routed to a sender called "%s". This is not a valid transport or serviceID.',$message,$sender));
17971797
}
17981798
}
17991799

‎src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/messenger_routing_invalid_transport.xml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
<framework:routingmessage-class="Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\DummyMessage">
1313
<framework:senderservice="invalid" />
1414
</framework:routing>
15-
<framework:routingmessage-class="Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\SecondMessage">
16-
<framework:senderservice="amqp" />
17-
<framework:senderservice="audit" />
18-
</framework:routing>
1915
<framework:transportname="amqp"dsn="amqp://localhost/%2f/messages" />
2016
</framework:messenger>
2117
</framework:config>

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
useSymfony\Component\DependencyInjection\ContainerBuilder;
3434
useSymfony\Component\DependencyInjection\ContainerInterface;
3535
useSymfony\Component\DependencyInjection\Definition;
36+
useSymfony\Component\DependencyInjection\Exception\InvalidArgumentException;
37+
useSymfony\Component\DependencyInjection\Exception\LogicException;
3638
useSymfony\Component\DependencyInjection\Loader\ClosureLoader;
3739
useSymfony\Component\DependencyInjection\ParameterBag\ParameterBag;
3840
useSymfony\Component\DependencyInjection\Reference;
@@ -768,15 +770,15 @@ public function testMessengerWithMultipleBuses()
768770

769771
publicfunctiontestMessengerMiddlewareFactoryErroneousFormat()
770772
{
771-
$this->expectException('InvalidArgumentException');
773+
$this->expectException(InvalidArgumentException::class);
772774
$this->expectExceptionMessage('Invalid middleware at path "framework.messenger": a map with a single factory id as key and its arguments as value was expected, {"foo":["qux"],"bar":["baz"]} given.');
773775
$this->createContainerFromFile('messenger_middleware_factory_erroneous_format');
774776
}
775777

776778
publicfunctiontestMessengerInvalidTransportRouting()
777779
{
778-
$this->expectException('LogicException');
779-
$this->expectExceptionMessage('Invalid Messenger routing configuration: the "Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\DummyMessage" class is being routed to a sender called "invalid". This is not a valid transport or serviceid.');
780+
$this->expectException(LogicException::class);
781+
$this->expectExceptionMessage('Invalid Messenger routing configuration: the "Symfony\Bundle\FrameworkBundle\Tests\Fixtures\Messenger\DummyMessage" class is being routed to a sender called "invalid". This is not a valid transport or serviceID.');
780782
$this->createContainerFromFile('messenger_routing_invalid_transport');
781783
}
782784

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp