*/ private $directParentMap = []; public function initialize(Automation $automation): void { $this->directParentMap = []; } public function visitNode(Automation $automation, AutomationNode $node): void { $step = $node->getStep(); foreach ($step->getNextStepIds() as $nextStepId) { $this->directParentMap[$nextStepId] = array_merge($this->directParentMap[$nextStepId] ?? [], [$step]); } if (count($this->directParentMap[$step->getId()] ?? []) > 1) { throw Exceptions::automationStructureNotValid(__('Path join found in automation graph', 'mailpoet'), self::RULE_ID); } } public function complete(Automation $automation): void { } }