fix many PHP 8.4 compatibility issues
This commit is contained in:
@ -160,7 +160,7 @@ class ContainerAwareEventDispatcher extends EventDispatcher
|
||||
*
|
||||
* @throws \InvalidArgumentException if the service is not defined
|
||||
*/
|
||||
public function dispatch($eventName, Event $event = null)
|
||||
public function dispatch($eventName, ?Event $event = null)
|
||||
{
|
||||
$this->lazyLoad($eventName);
|
||||
|
||||
|
@ -40,7 +40,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
|
||||
* @param Stopwatch $stopwatch A Stopwatch instance
|
||||
* @param LoggerInterface $logger A LoggerInterface instance
|
||||
*/
|
||||
public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, LoggerInterface $logger = null)
|
||||
public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, ?LoggerInterface $logger = null)
|
||||
{
|
||||
$this->dispatcher = $dispatcher;
|
||||
$this->stopwatch = $stopwatch;
|
||||
@ -110,7 +110,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function dispatch($eventName, Event $event = null)
|
||||
public function dispatch($eventName, ?Event $event = null)
|
||||
{
|
||||
if (null === $event) {
|
||||
$event = new Event();
|
||||
|
@ -27,7 +27,7 @@ class WrappedListener
|
||||
private $stopwatch;
|
||||
private $dispatcher;
|
||||
|
||||
public function __construct($listener, $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null)
|
||||
public function __construct($listener, $name, Stopwatch $stopwatch, ?EventDispatcherInterface $dispatcher = null)
|
||||
{
|
||||
$this->listener = $listener;
|
||||
$this->name = $name;
|
||||
|
@ -37,7 +37,7 @@ class EventDispatcher implements EventDispatcherInterface
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function dispatch($eventName, Event $event = null)
|
||||
public function dispatch($eventName, ?Event $event = null)
|
||||
{
|
||||
if (null === $event) {
|
||||
$event = new Event();
|
||||
|
@ -35,7 +35,7 @@ interface EventDispatcherInterface
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
public function dispatch($eventName, Event $event = null);
|
||||
public function dispatch($eventName, ?Event $event = null);
|
||||
|
||||
/**
|
||||
* Adds an event listener that listens on the specified events.
|
||||
|
@ -38,7 +38,7 @@ class ImmutableEventDispatcher implements EventDispatcherInterface
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function dispatch($eventName, Event $event = null)
|
||||
public function dispatch($eventName, ?Event $event = null)
|
||||
{
|
||||
return $this->dispatcher->dispatch($eventName, $event);
|
||||
}
|
||||
|
Reference in New Issue
Block a user