Add validation rule identifiers to exceptions and responses
[MAILPOET-4659]
This commit is contained in:
@@ -9,6 +9,8 @@ use MailPoet\Automation\Engine\Validation\WorkflowGraph\WorkflowNode;
|
||||
use MailPoet\Automation\Engine\Validation\WorkflowGraph\WorkflowNodeVisitor;
|
||||
|
||||
class TriggersUnderRootRule implements WorkflowNodeVisitor {
|
||||
public const RULE_ID = 'triggers-under-root';
|
||||
|
||||
/** @var array<string, Step> $triggersMap */
|
||||
private $triggersMap = [];
|
||||
|
||||
@@ -30,7 +32,7 @@ class TriggersUnderRootRule implements WorkflowNodeVisitor {
|
||||
foreach ($step->getNextSteps() as $nextStep) {
|
||||
$nextStepId = $nextStep->getId();
|
||||
if (isset($this->triggersMap[$nextStepId])) {
|
||||
throw Exceptions::workflowStructureNotValid(__('Trigger must be a direct descendant of workflow root', 'mailpoet'));
|
||||
throw Exceptions::workflowStructureNotValid(__('Trigger must be a direct descendant of workflow root', 'mailpoet'), self::RULE_ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user