workflowWalker = $workflowWalker; $this->stepsValidator = $stepsValidator; } public function validate(Workflow $workflow): void { // validate graph $this->workflowWalker->walk($workflow, [ new NoUnreachableStepsRule(), new ConsistentStepMapRule(), new NoDuplicateEdgesRule(), new TriggersUnderRootRule(), new NoCycleRule(), new NoJoinRule(), new NoSplitRule(), ]); // validate steps $this->stepsValidator->validateSteps($workflow); } }