triggerFound = false; } public function visitNode(Automation $automation, AutomationNode $node): void { if ($node->getStep()->getType() === Step::TYPE_TRIGGER) { $this->triggerFound = true; } } public function complete(Automation $automation): void { if (!$automation->needsFullValidation()) { return; } if ($this->triggerFound) { return; } throw Exceptions::automationStructureNotValid(__('There must be at least one trigger in the automation.', 'mailpoet'), self::RULE_ID); } }