@@ -42,7 +42,7 @@ class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterfa
42
42
private $ requestStack ;
43
43
private $ currentRequestHash = '' ;
44
44
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 )
46
46
{
47
47
$ this ->dispatcher = $ dispatcher ;
48
48
$ this ->stopwatch = $ stopwatch ;
@@ -97,7 +97,7 @@ public function removeSubscriber(EventSubscriberInterface $subscriber)
97
97
/**
98
98
* {@inheritdoc}
99
99
*/
100
- public function getListeners (string $ eventName = null )
100
+ public function getListeners (? string $ eventName = null )
101
101
{
102
102
return $ this ->dispatcher ->getListeners ($ eventName );
103
103
}
@@ -123,15 +123,15 @@ public function getListenerPriority(string $eventName, $listener)
123
123
/**
124
124
* {@inheritdoc}
125
125
*/
126
- public function hasListeners (string $ eventName = null )
126
+ public function hasListeners (? string $ eventName = null )
127
127
{
128
128
return $ this ->dispatcher ->hasListeners ($ eventName );
129
129
}
130
130
131
131
/**
132
132
* {@inheritdoc}
133
133
*/
134
- public function dispatch (object $ event , string $ eventName = null ): object
134
+ public function dispatch (object $ event , ? string $ eventName = null ): object
135
135
{
136
136
$ eventName = $ eventName ?? \get_class ($ event );
137
137
@@ -171,7 +171,7 @@ public function dispatch(object $event, string $eventName = null): object
171
171
/**
172
172
* @return array
173
173
*/
174
- public function getCalledListeners (Request $ request = null )
174
+ public function getCalledListeners (? Request $ request = null )
175
175
{
176
176
if (null === $ this ->callStack ) {
177
177
return [];
@@ -192,7 +192,7 @@ public function getCalledListeners(Request $request = null)
192
192
/**
193
193
* @return array
194
194
*/
195
- public function getNotCalledListeners (Request $ request = null )
195
+ public function getNotCalledListeners (? Request $ request = null )
196
196
{
197
197
try {
198
198
$ allListeners = $ this ->getListeners ();
@@ -235,7 +235,7 @@ public function getNotCalledListeners(Request $request = null)
235
235
return $ notCalled ;
236
236
}
237
237
238
- public function getOrphanedEvents (Request $ request = null ): array
238
+ public function getOrphanedEvents (? Request $ request = null ): array
239
239
{
240
240
if ($ request ) {
241
241
return $ this ->orphanedEvents [spl_object_hash ($ request )] ?? [];
0 commit comments