public function dispatch(object
$event, ?string
$eventName = null
): object
{ $event =
$this->dispatcher->
dispatch($event,
$eventName);
if (!
$event instanceof FlowEventAware
) { return $event;
} $flowLogEvent =
new FlowLogEvent(FlowLogEvent::NAME,
$event);
$this->dispatcher->
dispatch($flowLogEvent,
$flowLogEvent->
getName());
if (($event instanceof StoppableEventInterface &&
$event->
isPropagationStopped()) ||
$event->
getContext()->
hasState(Context::SKIP_TRIGGER_FLOW
) ) { return $event;
} $storableFlow =
$this->flowFactory->
create($event);
$this->
callFlowExecutor($storableFlow);
return $event;
}