This commit is contained in:
2025-05-12 14:25:25 +02:00
parent ab2db755ef
commit 9e378ca2b7
2719 changed files with 46505 additions and 60181 deletions

View File

@@ -42,7 +42,7 @@ class EventDispatcher implements EventDispatcherInterface
}
}
public function dispatch(object $event, string $eventName = null): object
public function dispatch(object $event, ?string $eventName = null): object
{
$eventName ??= $event::class;
@@ -59,7 +59,7 @@ class EventDispatcher implements EventDispatcherInterface
return $event;
}
public function getListeners(string $eventName = null): array
public function getListeners(?string $eventName = null): array
{
if (null !== $eventName) {
if (empty($this->listeners[$eventName])) {
@@ -108,7 +108,7 @@ class EventDispatcher implements EventDispatcherInterface
return null;
}
public function hasListeners(string $eventName = null): bool
public function hasListeners(?string $eventName = null): bool
{
if (null !== $eventName) {
return !empty($this->listeners[$eventName]);