$event =
new LeaveEvent($subject,
$marking,
$transition,
$this,
$context);
$this->dispatcher->
dispatch($event, WorkflowEvents::LEAVE
);
$this->dispatcher->
dispatch($event,
sprintf('workflow.%s.leave',
$this->name
));
foreach ($places as $place) { $this->dispatcher->
dispatch($event,
sprintf('workflow.%s.leave.%s',
$this->name,
$place));
} } foreach ($places as $place) { $marking->
unmark($place);
} } private function transition(object
$subject, Transition
$transition, Marking
$marking, array
$context): array
{ if (!
$this->
shouldDispatchEvent(WorkflowEvents::TRANSITION,
$context)) { return $context;
} $event =
new TransitionEvent($subject,
$marking,
$transition,
$this,
$context);