Skip to content

Commit c04ef1f

Browse files
committed
Merge remote-tracking branch 'jenkoian/symfony-command-routes' into client-fix-command-routing
2 parents 91629bc + 4302ae3 commit c04ef1f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

pkg/enqueue-bundle/DependencyInjection/Compiler/BuildClientRoutingPass.php

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Enqueue\Bundle\DependencyInjection\Compiler;
44

5+
use Enqueue\Client\Config;
56
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
67
use Symfony\Component\DependencyInjection\ContainerBuilder;
78

@@ -35,5 +36,15 @@ public function process(ContainerBuilder $container)
3536

3637
$router = $container->getDefinition($routerId);
3738
$router->replaceArgument(1, $configs);
39+
40+
if (isset($configs[Config::COMMAND_TOPIC])) {
41+
$commandRoutes = [];
42+
43+
foreach ($configs[Config::COMMAND_TOPIC] as $command) {
44+
$commandRoutes[$command[0]] = $command[1];
45+
}
46+
47+
$router->replaceArgument(2, $commandRoutes);
48+
}
3849
}
3950
}

pkg/enqueue-bundle/Resources/config/client.yml

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ services:
4242
arguments:
4343
- '@enqueue.client.driver'
4444
- []
45+
- []
4546
tags:
4647
-
4748
name: 'enqueue.client.processor'

0 commit comments

Comments
 (0)