PHP 8 Compatibility

This commit is contained in:
Frédéric Guillot
2022-02-05 11:49:03 -08:00
committed by GitHub
parent 61e63ef9e0
commit f5bb55bdb8
558 changed files with 6262 additions and 21691 deletions

View File

@@ -22,15 +22,26 @@ class ImmutableEventDispatcher implements EventDispatcherInterface
public function __construct(EventDispatcherInterface $dispatcher)
{
$this->dispatcher = $dispatcher;
$this->dispatcher = LegacyEventDispatcherProxy::decorate($dispatcher);
}
/**
* {@inheritdoc}
*
* @param string|null $eventName
*/
public function dispatch($eventName, Event $event = null)
public function dispatch($event/*, string $eventName = null*/)
{
return $this->dispatcher->dispatch($eventName, $event);
$eventName = 1 < \func_num_args() ? func_get_arg(1) : null;
if (is_scalar($event)) {
// deprecated
$swap = $event;
$event = $eventName ?? new Event();
$eventName = $swap;
}
return $this->dispatcher->dispatch($event, $eventName);
}
/**