Skip to content

Commit 5bb99ba

Browse files
Merge branch '7.0' into 7.1
* 7.0: List CS fix in .git-blame-ignore-revs 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 9f85f14 + 834c28d commit 5bb99ba

4 files changed

+14
-14
lines changed

Debug/TraceableEventDispatcher.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function removeSubscriber(EventSubscriberInterface $subscriber): void
7676
$this->dispatcher->removeSubscriber($subscriber);
7777
}
7878

79-
public function getListeners(string $eventName = null): array
79+
public function getListeners(?string $eventName = null): array
8080
{
8181
return $this->dispatcher->getListeners($eventName);
8282
}
@@ -96,12 +96,12 @@ public function getListenerPriority(string $eventName, callable|array $listener)
9696
return $this->dispatcher->getListenerPriority($eventName, $listener);
9797
}
9898

99-
public function hasListeners(string $eventName = null): bool
99+
public function hasListeners(?string $eventName = null): bool
100100
{
101101
return $this->dispatcher->hasListeners($eventName);
102102
}
103103

104-
public function dispatch(object $event, string $eventName = null): object
104+
public function dispatch(object $event, ?string $eventName = null): object
105105
{
106106
$eventName ??= $event::class;
107107

@@ -136,7 +136,7 @@ public function dispatch(object $event, string $eventName = null): object
136136
return $event;
137137
}
138138

139-
public function getCalledListeners(Request $request = null): array
139+
public function getCalledListeners(?Request $request = null): array
140140
{
141141
if (null === $this->callStack) {
142142
return [];
@@ -154,7 +154,7 @@ public function getCalledListeners(Request $request = null): array
154154
return $called;
155155
}
156156

157-
public function getNotCalledListeners(Request $request = null): array
157+
public function getNotCalledListeners(?Request $request = null): array
158158
{
159159
try {
160160
$allListeners = $this->dispatcher instanceof EventDispatcher ? $this->getListenersWithPriority() : $this->getListenersWithoutPriority();
@@ -196,7 +196,7 @@ public function getNotCalledListeners(Request $request = null): array
196196
return $notCalled;
197197
}
198198

199-
public function getOrphanedEvents(Request $request = null): array
199+
public function getOrphanedEvents(?Request $request = null): array
200200
{
201201
if ($request) {
202202
return $this->orphanedEvents[spl_object_hash($request)] ?? [];

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
@@ -23,7 +23,7 @@ public function __construct(
2323
) {
2424
}
2525

26-
public function dispatch(object $event, string $eventName = null): object
26+
public function dispatch(object $event, ?string $eventName = null): object
2727
{
2828
return $this->dispatcher->dispatch($event, $eventName);
2929
}
@@ -48,7 +48,7 @@ public function removeSubscriber(EventSubscriberInterface $subscriber): never
4848
throw new \BadMethodCallException('Unmodifiable event dispatchers must not be modified.');
4949
}
5050

51-
public function getListeners(string $eventName = null): array
51+
public function getListeners(?string $eventName = null): array
5252
{
5353
return $this->dispatcher->getListeners($eventName);
5454
}
@@ -58,7 +58,7 @@ public function getListenerPriority(string $eventName, callable|array $listener)
5858
return $this->dispatcher->getListenerPriority($eventName, $listener);
5959
}
6060

61-
public function hasListeners(string $eventName = null): bool
61+
public function hasListeners(?string $eventName = null): bool
6262
{
6363
return $this->dispatcher->hasListeners($eventName);
6464
}

0 commit comments

Comments
 (0)