/**
* Dispatches the given event on the internal dispatcher, does a fallback to the global one.
*
* @param EventInterface $event The event
*
* @return void
*
* @since 4.1.0
*/
protected function dispatchEvent(EventInterface $event)
{
try {
$this->getDispatcher()->dispatch($event->getName(), $event);
} catch (\UnexpectedValueException $e) {
Factory::getContainer()->get(DispatcherInterface::class)->dispatch($event->getName(), $event);
}
}