diff --git a/src/Events/DI/EventsExtension.php b/src/Events/DI/EventsExtension.php index 858999a..1345897 100644 --- a/src/Events/DI/EventsExtension.php +++ b/src/Events/DI/EventsExtension.php @@ -407,7 +407,7 @@ protected function bindEventProperties(Definition $def, \ReflectionClass $class) } $dispatchAnnotation = self::propertyHasAnnotation($property, 'globalDispatchFirst'); - $def->addSetup('$' . $name, [ + $def->addSetup('$' . $name . '[]', [ new Statement($this->prefix('@manager') . '::createEvent', [ [$class->getName(), $name], new PhpLiteral('$service->' . $name), diff --git a/src/Events/EventManager.php b/src/Events/EventManager.php index cd7be64..acc0cc9 100644 --- a/src/Events/EventManager.php +++ b/src/Events/EventManager.php @@ -75,7 +75,7 @@ public function setExceptionHandler(IExceptionHandler $exceptionHandler) * @param string $eventName The name of the event to dispatch. The name of the event is the name of the method that is invoked on listeners. * @param \Doctrine\Common\EventArgs $eventArgs The event arguments to pass to the event handlers/listeners. If not supplied, the single empty EventArgs instance is used */ - public function dispatchEvent($eventName, DoctrineEventArgs $eventArgs = NULL) + public function dispatchEvent($eventName, ?DoctrineEventArgs $eventArgs = NULL) { if ($this->panel) { $this->panel->eventDispatch($eventName, $eventArgs);