From 939594a07550bf011195513e974b51be7e275003 Mon Sep 17 00:00:00 2001 From: Pavel Batanov Date: Wed, 9 Jan 2019 21:11:06 +0300 Subject: [PATCH] Remove "other_middlewares" configuration --- src/DependencyInjection/CommandBusConfiguration.php | 1 - src/DependencyInjection/CommandBusExtension.php | 2 -- src/DependencyInjection/Compiler/ConfigureMiddlewares.php | 5 ----- .../Compiler/ConfigureMiddlewaresTest.php | 1 - 4 files changed, 9 deletions(-) diff --git a/src/DependencyInjection/CommandBusConfiguration.php b/src/DependencyInjection/CommandBusConfiguration.php index 5e4d006..464b50f 100644 --- a/src/DependencyInjection/CommandBusConfiguration.php +++ b/src/DependencyInjection/CommandBusConfiguration.php @@ -31,7 +31,6 @@ public function getConfigTreeBuilder() ->children() ->booleanNode('logger')->defaultFalse()->end() ->booleanNode('finishes_command_before_handling_next')->defaultTrue()->end() - ->booleanNode('other_middlewares')->defaultTrue()->end() ->end() ->end() ->arrayNode('logging') diff --git a/src/DependencyInjection/CommandBusExtension.php b/src/DependencyInjection/CommandBusExtension.php index 7e259d2..b22b401 100644 --- a/src/DependencyInjection/CommandBusExtension.php +++ b/src/DependencyInjection/CommandBusExtension.php @@ -57,7 +57,5 @@ protected function loadInternal(array $mergedConfig, ContainerBuilder $container $container->getDefinition('simple_bus.command_bus.finishes_command_before_handling_next_middleware') ->addTag('command_bus_middleware', ['priority' => 1000]); } - - $container->setParameter('simple_bus.command_bus.append_tagged_middlewares', $mergedConfig['middlewares']['other_middlewares']); } } diff --git a/src/DependencyInjection/Compiler/ConfigureMiddlewares.php b/src/DependencyInjection/Compiler/ConfigureMiddlewares.php index a65bb1a..394a9d8 100644 --- a/src/DependencyInjection/Compiler/ConfigureMiddlewares.php +++ b/src/DependencyInjection/Compiler/ConfigureMiddlewares.php @@ -26,11 +26,6 @@ public function process(ContainerBuilder $container) return; } - if (!$container->hasParameter('simple_bus.command_bus.append_tagged_middlewares') - || !$container->getParameter('simple_bus.command_bus.append_tagged_middlewares')) { - return; - } - $middlewareIds = new \SplPriorityQueue(); foreach ($container->findTaggedServiceIds($this->busTag) as $specializedBusId => $tags) { diff --git a/tests/SymfonyBundle/DependencyInjection/Compiler/ConfigureMiddlewaresTest.php b/tests/SymfonyBundle/DependencyInjection/Compiler/ConfigureMiddlewaresTest.php index c39f6c1..2802a39 100644 --- a/tests/SymfonyBundle/DependencyInjection/Compiler/ConfigureMiddlewaresTest.php +++ b/tests/SymfonyBundle/DependencyInjection/Compiler/ConfigureMiddlewaresTest.php @@ -34,7 +34,6 @@ protected function setUp() $this->mainBusDefinition->setPublic(true); $this->container->setDefinition($this->mainBusId, $this->mainBusDefinition); $this->container->addCompilerPass(new ConfigureMiddlewares($this->mainBusId, $this->middlewareTag)); - $this->container->setParameter('simple_bus.command_bus.append_tagged_middlewares', true); } /**