From 19e5c16805c1f80ac9ceecd8f1907c6378dd908c Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Fri, 2 Jul 2021 08:30:21 +0200 Subject: [PATCH] Remove ability to configure tags on RegisterListenersPass Signed-off-by: Alexander M. Turek --- .../RegisterListenersPass.php | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php b/src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php index cc481321c9abc..eebe2f62db0f5 100644 --- a/src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php +++ b/src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php @@ -26,9 +26,7 @@ class RegisterListenersPass implements CompilerPassInterface { private array $hotPathEvents = []; - private string $hotPathTagName = 'container.hot_path'; private array $noPreloadEvents = []; - private string $noPreloadTagName = 'container.no_preload'; /** * @return $this @@ -37,11 +35,6 @@ public function setHotPathEvents(array $hotPathEvents) { $this->hotPathEvents = array_flip($hotPathEvents); - if (1 < \func_num_args()) { - trigger_deprecation('symfony/event-dispatcher', '5.4', 'Configuring "$tagName" in "%s" is deprecated.', __METHOD__); - $this->hotPathTagName = func_get_arg(1); - } - return $this; } @@ -52,11 +45,6 @@ public function setNoPreloadEvents(array $noPreloadEvents): self { $this->noPreloadEvents = array_flip($noPreloadEvents); - if (1 < \func_num_args()) { - trigger_deprecation('symfony/event-dispatcher', '5.4', 'Configuring "$tagName" in "%s" is deprecated.', __METHOD__); - $this->noPreloadTagName = func_get_arg(1); - } - return $this; } @@ -111,14 +99,14 @@ public function process(ContainerBuilder $container) $dispatcherDefinition->addMethodCall('addListener', [$event['event'], [new ServiceClosureArgument(new Reference($id)), $event['method']], $priority]); if (isset($this->hotPathEvents[$event['event']])) { - $container->getDefinition($id)->addTag($this->hotPathTagName); + $container->getDefinition($id)->addTag('container.hot_path'); } elseif (isset($this->noPreloadEvents[$event['event']])) { ++$noPreload; } } if ($noPreload && \count($events) === $noPreload) { - $container->getDefinition($id)->addTag($this->noPreloadTagName); + $container->getDefinition($id)->addTag('container.no_preload'); } } @@ -162,13 +150,13 @@ public function process(ContainerBuilder $container) } if (isset($this->hotPathEvents[$args[0]])) { - $container->getDefinition($id)->addTag($this->hotPathTagName); + $container->getDefinition($id)->addTag('container.hot_path'); } elseif (isset($this->noPreloadEvents[$args[0]])) { ++$noPreload; } } if ($noPreload && \count($extractingDispatcher->listeners) === $noPreload) { - $container->getDefinition($id)->addTag($this->noPreloadTagName); + $container->getDefinition($id)->addTag('container.no_preload'); } $extractingDispatcher->listeners = []; ExtractingEventDispatcher::$aliases = [];