🔧
This commit is contained in:
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user