dispatcher = $eventDispatcher; } public function dispatch(Event $event, string $eventName = null): void { $interfacesImplemented = class_implements($this->dispatcher); if (in_array(SymfonyEventDispatcherContract::class, $interfacesImplemented, true)) { $this->dispatcher->dispatch($event, $eventName); return; } $this->dispatcher->dispatch($eventName, $event); } }