getStep(); if ($step->getType() !== Step::TYPE_TRIGGER) { return; } $nextSteps = $step->getNextSteps(); if (!count($nextSteps)) { throw Exceptions::workflowStructureNotValid(__('A trigger needs to be followed by an action.', 'mailpoet'), self::RULE_ID); } foreach ($nextSteps as $step) { $step = $workflow->getStep($step->getId()); if ($step && $step->getType() === Step::TYPE_ACTION) { continue; } throw Exceptions::workflowStructureNotValid(__('A trigger needs to be followed by an action.', 'mailpoet'), self::RULE_ID); } } public function complete(Workflow $workflow): void { } }