26
26
class RegisterListenersPass implements CompilerPassInterface
27
27
{
28
28
private array $ hotPathEvents = [];
29
- private string $ hotPathTagName = 'container.hot_path ' ;
30
29
private array $ noPreloadEvents = [];
31
- private string $ noPreloadTagName = 'container.no_preload ' ;
32
30
33
31
/**
34
32
* @return $this
@@ -37,11 +35,6 @@ public function setHotPathEvents(array $hotPathEvents)
37
35
{
38
36
$ this ->hotPathEvents = array_flip ($ hotPathEvents );
39
37
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
-
45
38
return $ this ;
46
39
}
47
40
@@ -52,11 +45,6 @@ public function setNoPreloadEvents(array $noPreloadEvents): self
52
45
{
53
46
$ this ->noPreloadEvents = array_flip ($ noPreloadEvents );
54
47
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
-
60
48
return $ this ;
61
49
}
62
50
@@ -111,14 +99,14 @@ public function process(ContainerBuilder $container)
111
99
$ dispatcherDefinition ->addMethodCall ('addListener ' , [$ event ['event ' ], [new ServiceClosureArgument (new Reference ($ id )), $ event ['method ' ]], $ priority ]);
112
100
113
101
if (isset ($ this ->hotPathEvents [$ event ['event ' ]])) {
114
- $ container ->getDefinition ($ id )->addTag ($ this -> hotPathTagName );
102
+ $ container ->getDefinition ($ id )->addTag (' container.hot_path ' );
115
103
} elseif (isset ($ this ->noPreloadEvents [$ event ['event ' ]])) {
116
104
++$ noPreload ;
117
105
}
118
106
}
119
107
120
108
if ($ noPreload && \count ($ events ) === $ noPreload ) {
121
- $ container ->getDefinition ($ id )->addTag ($ this -> noPreloadTagName );
109
+ $ container ->getDefinition ($ id )->addTag (' container.no_preload ' );
122
110
}
123
111
}
124
112
@@ -162,13 +150,13 @@ public function process(ContainerBuilder $container)
162
150
}
163
151
164
152
if (isset ($ this ->hotPathEvents [$ args [0 ]])) {
165
- $ container ->getDefinition ($ id )->addTag ($ this -> hotPathTagName );
153
+ $ container ->getDefinition ($ id )->addTag (' container.hot_path ' );
166
154
} elseif (isset ($ this ->noPreloadEvents [$ args [0 ]])) {
167
155
++$ noPreload ;
168
156
}
169
157
}
170
158
if ($ noPreload && \count ($ extractingDispatcher ->listeners ) === $ noPreload ) {
171
- $ container ->getDefinition ($ id )->addTag ($ this -> noPreloadTagName );
159
+ $ container ->getDefinition ($ id )->addTag (' container.no_preload ' );
172
160
}
173
161
$ extractingDispatcher ->listeners = [];
174
162
ExtractingEventDispatcher::$ aliases = [];
0 commit comments