@@ -43,7 +43,7 @@ class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterfa
4343 private ?RequestStack $ requestStack ;
4444 private string $ currentRequestHash = '' ;
4545
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 )
4747 {
4848 $ this ->dispatcher = $ dispatcher ;
4949 $ this ->stopwatch = $ stopwatch ;
@@ -81,7 +81,7 @@ public function removeSubscriber(EventSubscriberInterface $subscriber): void
8181 $ this ->dispatcher ->removeSubscriber ($ subscriber );
8282 }
8383
84- public function getListeners (string $ eventName = null ): array
84+ public function getListeners (? string $ eventName = null ): array
8585 {
8686 return $ this ->dispatcher ->getListeners ($ eventName );
8787 }
@@ -101,12 +101,12 @@ public function getListenerPriority(string $eventName, callable|array $listener)
101101 return $ this ->dispatcher ->getListenerPriority ($ eventName , $ listener );
102102 }
103103
104- public function hasListeners (string $ eventName = null ): bool
104+ public function hasListeners (? string $ eventName = null ): bool
105105 {
106106 return $ this ->dispatcher ->hasListeners ($ eventName );
107107 }
108108
109- public function dispatch (object $ event , string $ eventName = null ): object
109+ public function dispatch (object $ event , ? string $ eventName = null ): object
110110 {
111111 $ eventName ??= $ event ::class;
112112
@@ -141,7 +141,7 @@ public function dispatch(object $event, string $eventName = null): object
141141 return $ event ;
142142 }
143143
144- public function getCalledListeners (Request $ request = null ): array
144+ public function getCalledListeners (? Request $ request = null ): array
145145 {
146146 if (null === $ this ->callStack ) {
147147 return [];
@@ -159,7 +159,7 @@ public function getCalledListeners(Request $request = null): array
159159 return $ called ;
160160 }
161161
162- public function getNotCalledListeners (Request $ request = null ): array
162+ public function getNotCalledListeners (? Request $ request = null ): array
163163 {
164164 try {
165165 $ allListeners = $ this ->dispatcher instanceof EventDispatcher ? $ this ->getListenersWithPriority () : $ this ->getListenersWithoutPriority ();
@@ -201,7 +201,7 @@ public function getNotCalledListeners(Request $request = null): array
201201 return $ notCalled ;
202202 }
203203
204- public function getOrphanedEvents (Request $ request = null ): array
204+ public function getOrphanedEvents (? Request $ request = null ): array
205205 {
206206 if ($ request ) {
207207 return $ this ->orphanedEvents [spl_object_hash ($ request )] ?? [];
0 commit comments