class FlowFactory{ /**
* @param FlowStorer[] $storer
*/
public function __construct(private $storer) { } public function create(FlowEventAware
$event): StorableFlow
{ $stored =
$this->
getStored($event);
return $this->
restore($event->
getName(),
$event->
getContext(),
$stored);
} /**
* @param array<string, mixed> $stored
* @param array<string, mixed> $data
*/
public function restore(string
$name, Context
$context, array
$stored =
[], array
$data =
[]): StorableFlow
{ $systemContext =
new Context(