@@ -31,9 +31,9 @@ class RegisterListenersPass implements CompilerPassInterface
31
31
protected $ eventAliasesParameter ;
32
32
33
33
private $ hotPathEvents = [];
34
- private $ hotPathTagName ;
34
+ private $ hotPathTagName = ' container.hot_path ' ;
35
35
private $ noPreloadEvents = [];
36
- private $ noPreloadTagName ;
36
+ private $ noPreloadTagName = ' container.no_preload ' ;
37
37
38
38
public function __construct (string $ dispatcherService = 'event_dispatcher ' , string $ listenerTag = 'kernel.event_listener ' , string $ subscriberTag = 'kernel.event_subscriber ' , string $ eventAliasesParameter = 'event_dispatcher.event_aliases ' )
39
39
{
@@ -50,21 +50,29 @@ public function __construct(string $dispatcherService = 'event_dispatcher', stri
50
50
/**
51
51
* @return $this
52
52
*/
53
- public function setHotPathEvents (array $ hotPathEvents, string $ tagName = ' container.hot_path ' )
53
+ public function setHotPathEvents (array $ hotPathEvents )
54
54
{
55
55
$ this ->hotPathEvents = array_flip ($ hotPathEvents );
56
- $ this ->hotPathTagName = $ tagName ;
56
+
57
+ if (1 < \func_num_args ()) {
58
+ trigger_deprecation ('symfony/event-dispatcher ' , '5.4 ' , 'Configuring "$tagName" in "%s" is deprecated. ' , __METHOD__ );
59
+ $ this ->hotPathTagName = func_get_arg (1 );
60
+ }
57
61
58
62
return $ this ;
59
63
}
60
64
61
65
/**
62
66
* @return $this
63
67
*/
64
- public function setNoPreloadEvents (array $ noPreloadEvents, string $ tagName = ' container.no_preload ' ): self
68
+ public function setNoPreloadEvents (array $ noPreloadEvents ): self
65
69
{
66
70
$ this ->noPreloadEvents = array_flip ($ noPreloadEvents );
67
- $ this ->noPreloadTagName = $ tagName ;
71
+
72
+ if (1 < \func_num_args ()) {
73
+ trigger_deprecation ('symfony/event-dispatcher ' , '5.4 ' , 'Configuring "$tagName" in "%s" is deprecated. ' , __METHOD__ );
74
+ $ this ->noPreloadTagName = func_get_arg (1 );
75
+ }
68
76
69
77
return $ this ;
70
78
}
0 commit comments