Skip to content

Commit 834c28d

Browse files
Merge branch '6.4' into 7.0
* 6.4: Fix implicitly-required parameters minor #53524 [Messenger] [AmazonSqs] Allow `async-aws/sqs` version 2 (smoench) Fix bad merge List CS fix in .git-blame-ignore-revs 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 098b62a + ae9d3a6 commit 834c28d

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;
@@ -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)] ?? [];

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
@@ -50,7 +50,7 @@ public function removeSubscriber(EventSubscriberInterface $subscriber): void;
5050
*
5151
* @return array<callable[]|callable>
5252
*/
53-
public function getListeners(string $eventName = null): array;
53+
public function getListeners(?string $eventName = null): array;
5454

5555
/**
5656
* Gets the listener priority for a specific event.
@@ -62,5 +62,5 @@ public function getListenerPriority(string $eventName, callable $listener): ?int
6262
/**
6363
* Checks whether an event has any registered listeners.
6464
*/
65-
public function hasListeners(string $eventName = null): bool;
65+
public function hasListeners(?string $eventName = null): bool;
6666
}

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
}
@@ -50,7 +50,7 @@ public function removeSubscriber(EventSubscriberInterface $subscriber): never
5050
throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
5151
}
5252

53-
public function getListeners(string $eventName = null): array
53+
public function getListeners(?string $eventName = null): array
5454
{
5555
return $this->dispatcher->getListeners($eventName);
5656
}
@@ -60,7 +60,7 @@ public function getListenerPriority(string $eventName, callable|array $listener)
6060
return $this->dispatcher->getListenerPriority($eventName, $listener);
6161
}
6262

63-
public function hasListeners(string $eventName = null): bool
63+
public function hasListeners(?string $eventName = null): bool
6464
{
6565
return $this->dispatcher->hasListeners($eventName);
6666
}

0 commit comments

Comments
 (0)