@@ -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 ;
@@ -81,7 +81,7 @@ public function removeSubscriber(EventSubscriberInterface $subscriber): void
81
81
$ this ->dispatcher ->removeSubscriber ($ subscriber );
82
82
}
83
83
84
- public function getListeners (string $ eventName = null ): array
84
+ public function getListeners (? string $ eventName = null ): array
85
85
{
86
86
return $ this ->dispatcher ->getListeners ($ eventName );
87
87
}
@@ -101,12 +101,12 @@ public function getListenerPriority(string $eventName, callable|array $listener)
101
101
return $ this ->dispatcher ->getListenerPriority ($ eventName , $ listener );
102
102
}
103
103
104
- public function hasListeners (string $ eventName = null ): bool
104
+ public function hasListeners (? string $ eventName = null ): bool
105
105
{
106
106
return $ this ->dispatcher ->hasListeners ($ eventName );
107
107
}
108
108
109
- public function dispatch (object $ event , string $ eventName = null ): object
109
+ public function dispatch (object $ event , ? string $ eventName = null ): object
110
110
{
111
111
$ eventName ??= $ event ::class;
112
112
@@ -141,7 +141,7 @@ public function dispatch(object $event, string $eventName = null): object
141
141
return $ event ;
142
142
}
143
143
144
- public function getCalledListeners (Request $ request = null ): array
144
+ public function getCalledListeners (? Request $ request = null ): array
145
145
{
146
146
if (null === $ this ->callStack ) {
147
147
return [];
@@ -159,7 +159,7 @@ public function getCalledListeners(Request $request = null): array
159
159
return $ called ;
160
160
}
161
161
162
- public function getNotCalledListeners (Request $ request = null ): array
162
+ public function getNotCalledListeners (? Request $ request = null ): array
163
163
{
164
164
try {
165
165
$ allListeners = $ this ->dispatcher instanceof EventDispatcher ? $ this ->getListenersWithPriority () : $ this ->getListenersWithoutPriority ();
@@ -201,7 +201,7 @@ public function getNotCalledListeners(Request $request = null): array
201
201
return $ notCalled ;
202
202
}
203
203
204
- public function getOrphanedEvents (Request $ request = null ): array
204
+ public function getOrphanedEvents (? Request $ request = null ): array
205
205
{
206
206
if ($ request ) {
207
207
return $ this ->orphanedEvents [spl_object_hash ($ request )] ?? [];
0 commit comments