@@ -42,7 +42,7 @@ class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterfa
4242 private $ requestStack ;
4343 private $ currentRequestHash = '' ;
4444
45- public function __construct (EventDispatcherInterface $ dispatcher , Stopwatch $ stopwatch , LoggerInterface $ logger = null , RequestStack $ requestStack = null )
45+ public function __construct (EventDispatcherInterface $ dispatcher , Stopwatch $ stopwatch , ? LoggerInterface $ logger = null , ? RequestStack $ requestStack = null )
4646 {
4747 $ this ->dispatcher = $ dispatcher ;
4848 $ this ->stopwatch = $ stopwatch ;
@@ -97,7 +97,7 @@ public function removeSubscriber(EventSubscriberInterface $subscriber)
9797 /**
9898 * {@inheritdoc}
9999 */
100- public function getListeners (string $ eventName = null )
100+ public function getListeners (? string $ eventName = null )
101101 {
102102 return $ this ->dispatcher ->getListeners ($ eventName );
103103 }
@@ -123,15 +123,15 @@ public function getListenerPriority(string $eventName, $listener)
123123 /**
124124 * {@inheritdoc}
125125 */
126- public function hasListeners (string $ eventName = null )
126+ public function hasListeners (? string $ eventName = null )
127127 {
128128 return $ this ->dispatcher ->hasListeners ($ eventName );
129129 }
130130
131131 /**
132132 * {@inheritdoc}
133133 */
134- public function dispatch (object $ event , string $ eventName = null ): object
134+ public function dispatch (object $ event , ? string $ eventName = null ): object
135135 {
136136 $ eventName = $ eventName ?? \get_class ($ event );
137137
@@ -171,7 +171,7 @@ public function dispatch(object $event, string $eventName = null): object
171171 /**
172172 * @return array
173173 */
174- public function getCalledListeners (Request $ request = null )
174+ public function getCalledListeners (? Request $ request = null )
175175 {
176176 if (null === $ this ->callStack ) {
177177 return [];
@@ -192,7 +192,7 @@ public function getCalledListeners(Request $request = null)
192192 /**
193193 * @return array
194194 */
195- public function getNotCalledListeners (Request $ request = null )
195+ public function getNotCalledListeners (? Request $ request = null )
196196 {
197197 try {
198198 $ allListeners = $ this ->getListeners ();
@@ -235,7 +235,7 @@ public function getNotCalledListeners(Request $request = null)
235235 return $ notCalled ;
236236 }
237237
238- public function getOrphanedEvents (Request $ request = null ): array
238+ public function getOrphanedEvents (? Request $ request = null ): array
239239 {
240240 if ($ request ) {
241241 return $ this ->orphanedEvents [spl_object_hash ($ request )] ?? [];
0 commit comments