Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 19e5c16

Browse files
derrabusnicolas-grekas
authored andcommitted
Remove ability to configure tags on RegisterListenersPass
Signed-off-by: Alexander M. Turek <[email protected]>
1 parent f06eae0 commit 19e5c16

File tree

1 file changed

+4
-16
lines changed

1 file changed

+4
-16
lines changed

src/Symfony/Component/EventDispatcher/DependencyInjection/RegisterListenersPass.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626
class RegisterListenersPass implements CompilerPassInterface
2727
{
2828
private array $hotPathEvents = [];
29-
private string $hotPathTagName = 'container.hot_path';
3029
private array $noPreloadEvents = [];
31-
private string $noPreloadTagName = 'container.no_preload';
3230

3331
/**
3432
* @return $this
@@ -37,11 +35,6 @@ public function setHotPathEvents(array $hotPathEvents)
3735
{
3836
$this->hotPathEvents = array_flip($hotPathEvents);
3937

40-
if (1 < \func_num_args()) {
41-
trigger_deprecation('symfony/event-dispatcher', '5.4', 'Configuring "$tagName" in "%s" is deprecated.', __METHOD__);
42-
$this->hotPathTagName = func_get_arg(1);
43-
}
44-
4538
return $this;
4639
}
4740

@@ -52,11 +45,6 @@ public function setNoPreloadEvents(array $noPreloadEvents): self
5245
{
5346
$this->noPreloadEvents = array_flip($noPreloadEvents);
5447

55-
if (1 < \func_num_args()) {
56-
trigger_deprecation('symfony/event-dispatcher', '5.4', 'Configuring "$tagName" in "%s" is deprecated.', __METHOD__);
57-
$this->noPreloadTagName = func_get_arg(1);
58-
}
59-
6048
return $this;
6149
}
6250

@@ -111,14 +99,14 @@ public function process(ContainerBuilder $container)
11199
$dispatcherDefinition->addMethodCall('addListener', [$event['event'], [new ServiceClosureArgument(new Reference($id)), $event['method']], $priority]);
112100

113101
if (isset($this->hotPathEvents[$event['event']])) {
114-
$container->getDefinition($id)->addTag($this->hotPathTagName);
102+
$container->getDefinition($id)->addTag('container.hot_path');
115103
} elseif (isset($this->noPreloadEvents[$event['event']])) {
116104
++$noPreload;
117105
}
118106
}
119107

120108
if ($noPreload && \count($events) === $noPreload) {
121-
$container->getDefinition($id)->addTag($this->noPreloadTagName);
109+
$container->getDefinition($id)->addTag('container.no_preload');
122110
}
123111
}
124112

@@ -162,13 +150,13 @@ public function process(ContainerBuilder $container)
162150
}
163151

164152
if (isset($this->hotPathEvents[$args[0]])) {
165-
$container->getDefinition($id)->addTag($this->hotPathTagName);
153+
$container->getDefinition($id)->addTag('container.hot_path');
166154
} elseif (isset($this->noPreloadEvents[$args[0]])) {
167155
++$noPreload;
168156
}
169157
}
170158
if ($noPreload && \count($extractingDispatcher->listeners) === $noPreload) {
171-
$container->getDefinition($id)->addTag($this->noPreloadTagName);
159+
$container->getDefinition($id)->addTag('container.no_preload');
172160
}
173161
$extractingDispatcher->listeners = [];
174162
ExtractingEventDispatcher::$aliases = [];

0 commit comments

Comments
 (0)