8889841cwp-content/plugins/mailpoet/lib/Automation/Engine/Validation/AutomationRules/NoCycleRule.php000064400000002372150513416050034161 0ustar00home/clixcotz/tcchp.clix.co.tzgetStep(); $parents = $node->getParents(); $parentIdsMap = array_combine( array_map(function (Step $parent) { return $parent->getId(); }, $node->getParents()), $parents ) ?: []; foreach ($step->getNextSteps() as $nextStep) { $nextStepId = $nextStep->getId(); if ($nextStepId === $step->getId() || isset($parentIdsMap[$nextStepId])) { throw Exceptions::automationStructureNotValid(__('Cycle found in automation graph', 'mailpoet'), self::RULE_ID); } } } public function complete(Automation $automation): void { } }