Skip to content

Commit 6e344dd

Browse files
committedJan 23, 2024
Merge branch '5.4' into 6.3
* 5.4: Fix implicitly-required parameters List CS fix in .git-blame-ignore-revs Apply php-cs-fixer fix --rules nullable_type_declaration_for_default_null_value [Messenger][AmazonSqs] Allow async-aws/sqs version 2
2 parents 4b4738c + 7a69a85 commit 6e344dd

5 files changed

+16
-16
lines changed
 

‎Debug/TraceableEventDispatcher.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -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;
@@ -93,7 +93,7 @@ public function removeSubscriber(EventSubscriberInterface $subscriber)
9393
$this->dispatcher->removeSubscriber($subscriber);
9494
}
9595

96-
public function getListeners(string $eventName = null): array
96+
public function getListeners(?string $eventName = null): array
9797
{
9898
return $this->dispatcher->getListeners($eventName);
9999
}
@@ -113,12 +113,12 @@ public function getListenerPriority(string $eventName, callable|array $listener)
113113
return $this->dispatcher->getListenerPriority($eventName, $listener);
114114
}
115115

116-
public function hasListeners(string $eventName = null): bool
116+
public function hasListeners(?string $eventName = null): bool
117117
{
118118
return $this->dispatcher->hasListeners($eventName);
119119
}
120120

121-
public function dispatch(object $event, string $eventName = null): object
121+
public function dispatch(object $event, ?string $eventName = null): object
122122
{
123123
$eventName ??= $event::class;
124124

@@ -153,7 +153,7 @@ public function dispatch(object $event, string $eventName = null): object
153153
return $event;
154154
}
155155

156-
public function getCalledListeners(Request $request = null): array
156+
public function getCalledListeners(?Request $request = null): array
157157
{
158158
if (null === $this->callStack) {
159159
return [];
@@ -171,7 +171,7 @@ public function getCalledListeners(Request $request = null): array
171171
return $called;
172172
}
173173

174-
public function getNotCalledListeners(Request $request = null): array
174+
public function getNotCalledListeners(?Request $request = null): array
175175
{
176176
try {
177177
$allListeners = $this->dispatcher instanceof EventDispatcher ? $this->getListenersWithPriority() : $this->getListenersWithoutPriority();
@@ -213,7 +213,7 @@ public function getNotCalledListeners(Request $request = null): array
213213
return $notCalled;
214214
}
215215

216-
public function getOrphanedEvents(Request $request = null): array
216+
public function getOrphanedEvents(?Request $request = null): array
217217
{
218218
if ($request) {
219219
return $this->orphanedEvents[spl_object_hash($request)] ?? [];

‎Debug/WrappedListener.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ final class WrappedListener
3434
private ?int $priority = null;
3535
private static bool $hasClassStub;
3636

37-
public function __construct(callable|array $listener, ?string $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null, int $priority = null)
37+
public function __construct(callable|array $listener, ?string $name, Stopwatch $stopwatch, ?EventDispatcherInterface $dispatcher = null, ?int $priority = null)
3838
{
3939
$this->listener = $listener;
4040
$this->optimizedListener = $listener instanceof \Closure ? $listener : (\is_callable($listener) ? $listener(...) : null);

‎EventDispatcher.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct()
4242
}
4343
}
4444

45-
public function dispatch(object $event, string $eventName = null): object
45+
public function dispatch(object $event, ?string $eventName = null): object
4646
{
4747
$eventName ??= $event::class;
4848

@@ -59,7 +59,7 @@ public function dispatch(object $event, string $eventName = null): object
5959
return $event;
6060
}
6161

62-
public function getListeners(string $eventName = null): array
62+
public function getListeners(?string $eventName = null): array
6363
{
6464
if (null !== $eventName) {
6565
if (empty($this->listeners[$eventName])) {
@@ -108,7 +108,7 @@ public function getListenerPriority(string $eventName, callable|array $listener)
108108
return null;
109109
}
110110

111-
public function hasListeners(string $eventName = null): bool
111+
public function hasListeners(?string $eventName = null): bool
112112
{
113113
if (null !== $eventName) {
114114
return !empty($this->listeners[$eventName]);

‎EventDispatcherInterface.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function removeSubscriber(EventSubscriberInterface $subscriber);
5959
*
6060
* @return array<callable[]|callable>
6161
*/
62-
public function getListeners(string $eventName = null): array;
62+
public function getListeners(?string $eventName = null): array;
6363

6464
/**
6565
* Gets the listener priority for a specific event.
@@ -71,5 +71,5 @@ public function getListenerPriority(string $eventName, callable $listener): ?int
7171
/**
7272
* Checks whether an event has any registered listeners.
7373
*/
74-
public function hasListeners(string $eventName = null): bool;
74+
public function hasListeners(?string $eventName = null): bool;
7575
}

‎ImmutableEventDispatcher.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __construct(EventDispatcherInterface $dispatcher)
2525
$this->dispatcher = $dispatcher;
2626
}
2727

28-
public function dispatch(object $event, string $eventName = null): object
28+
public function dispatch(object $event, ?string $eventName = null): object
2929
{
3030
return $this->dispatcher->dispatch($event, $eventName);
3131
}
@@ -62,7 +62,7 @@ public function removeSubscriber(EventSubscriberInterface $subscriber)
6262
throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
6363
}
6464

65-
public function getListeners(string $eventName = null): array
65+
public function getListeners(?string $eventName = null): array
6666
{
6767
return $this->dispatcher->getListeners($eventName);
6868
}
@@ -72,7 +72,7 @@ public function getListenerPriority(string $eventName, callable|array $listener)
7272
return $this->dispatcher->getListenerPriority($eventName, $listener);
7373
}
7474

75-
public function hasListeners(string $eventName = null): bool
75+
public function hasListeners(?string $eventName = null): bool
7676
{
7777
return $this->dispatcher->hasListeners($eventName);
7878
}

0 commit comments

Comments
 (0)
Please sign in to comment.