diff --git a/mailpoet/lib/Automation/Engine/Registry.php b/mailpoet/lib/Automation/Engine/Registry.php index 80fb7e1cf3..f9fa4786cf 100644 --- a/mailpoet/lib/Automation/Engine/Registry.php +++ b/mailpoet/lib/Automation/Engine/Registry.php @@ -4,6 +4,7 @@ namespace MailPoet\Automation\Engine; use MailPoet\Automation\Engine\Control\RootStep; use MailPoet\Automation\Engine\Workflows\Action; +use MailPoet\Automation\Engine\Workflows\Payload; use MailPoet\Automation\Engine\Workflows\Step; use MailPoet\Automation\Engine\Workflows\Subject; use MailPoet\Automation\Engine\Workflows\Trigger; @@ -12,7 +13,7 @@ class Registry { /** @var array */ private $steps = []; - /** @var array */ + /** @var array> */ private $subjects = []; /** @var array */ @@ -32,6 +33,7 @@ class Registry { $this->steps[$rootStep->getKey()] = $rootStep; } + /** @param Subject $subject */ public function addSubject(Subject $subject): void { $key = $subject->getKey(); if (isset($this->subjects[$key])) { @@ -40,11 +42,12 @@ class Registry { $this->subjects[$key] = $subject; } + /** @return Subject|null */ public function getSubject(string $key): ?Subject { return $this->subjects[$key] ?? null; } - /** @return array */ + /** @return array> */ public function getSubjects(): array { return $this->subjects; } diff --git a/mailpoet/lib/Automation/Engine/Workflows/Payload.php b/mailpoet/lib/Automation/Engine/Workflows/Payload.php new file mode 100644 index 0000000000..fa73af8718 --- /dev/null +++ b/mailpoet/lib/Automation/Engine/Workflows/Payload.php @@ -0,0 +1,6 @@ + */ - public function getFields(): array; + public function getName(): string; - public function load(array $args): void; + public function getArgsSchema(): ObjectSchema; - public function pack(): array; + /** @return T */ + public function getPayload(SubjectData $subjectData): Payload; }