{ } public function dispatch(object
$event, ?string
$eventName = null
): object
{ $event =
$this->dispatcher->
dispatch($event,
$eventName);
if (EnvironmentHelper::
getVariable('DISABLE_EXTENSIONS', false
)) { return $event;
} foreach ($this->eventFactory->
createHookablesFor($event) as $hookable) { $context = Context::
createDefaultContext();
if ($event instanceof FlowEventAware ||
$event instanceof AppChangedEvent ||
$event instanceof EntityWrittenContainerEvent
) { $context =
$event->
getContext();
} $this->
callWebhooks($hookable,
$context);
} // always return the original event and never our wrapped events
// this would lead to problems in the `BusinessEventDispatcher` from core
return $event;
}