@@ -43,7 +43,7 @@ class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterfa
43
43
private ?RequestStack $ requestStack ;
44
44
private string $ currentRequestHash = '' ;
45
45
46
- public function __construct (EventDispatcherInterface $ dispatcher , Stopwatch $ stopwatch , LoggerInterface $ logger = null , RequestStack $ requestStack = null )
46
+ public function __construct (EventDispatcherInterface $ dispatcher , Stopwatch $ stopwatch , ? LoggerInterface $ logger = null , ? RequestStack $ requestStack = null )
47
47
{
48
48
$ this ->dispatcher = $ dispatcher ;
49
49
$ this ->stopwatch = $ stopwatch ;
@@ -93,7 +93,7 @@ public function removeSubscriber(EventSubscriberInterface $subscriber)
93
93
$ this ->dispatcher ->removeSubscriber ($ subscriber );
94
94
}
95
95
96
- public function getListeners (string $ eventName = null ): array
96
+ public function getListeners (? string $ eventName = null ): array
97
97
{
98
98
return $ this ->dispatcher ->getListeners ($ eventName );
99
99
}
@@ -113,12 +113,12 @@ public function getListenerPriority(string $eventName, callable|array $listener)
113
113
return $ this ->dispatcher ->getListenerPriority ($ eventName , $ listener );
114
114
}
115
115
116
- public function hasListeners (string $ eventName = null ): bool
116
+ public function hasListeners (? string $ eventName = null ): bool
117
117
{
118
118
return $ this ->dispatcher ->hasListeners ($ eventName );
119
119
}
120
120
121
- public function dispatch (object $ event , string $ eventName = null ): object
121
+ public function dispatch (object $ event , ? string $ eventName = null ): object
122
122
{
123
123
$ eventName ??= $ event ::class;
124
124
@@ -153,7 +153,7 @@ public function dispatch(object $event, string $eventName = null): object
153
153
return $ event ;
154
154
}
155
155
156
- public function getCalledListeners (Request $ request = null ): array
156
+ public function getCalledListeners (? Request $ request = null ): array
157
157
{
158
158
if (null === $ this ->callStack ) {
159
159
return [];
@@ -171,7 +171,7 @@ public function getCalledListeners(Request $request = null): array
171
171
return $ called ;
172
172
}
173
173
174
- public function getNotCalledListeners (Request $ request = null ): array
174
+ public function getNotCalledListeners (? Request $ request = null ): array
175
175
{
176
176
try {
177
177
$ allListeners = $ this ->dispatcher instanceof EventDispatcher ? $ this ->getListenersWithPriority () : $ this ->getListenersWithoutPriority ();
@@ -213,7 +213,7 @@ public function getNotCalledListeners(Request $request = null): array
213
213
return $ notCalled ;
214
214
}
215
215
216
- public function getOrphanedEvents (Request $ request = null ): array
216
+ public function getOrphanedEvents (? Request $ request = null ): array
217
217
{
218
218
if ($ request ) {
219
219
return $ this ->orphanedEvents [spl_object_hash ($ request )] ?? [];
0 commit comments