init
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Automation\Engine\Integration;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\Automation\Engine\Control\StepRunController;
|
||||
use MailPoet\Automation\Engine\Data\StepRunArgs;
|
||||
|
||||
interface Action extends Step {
|
||||
public function run(StepRunArgs $args, StepRunController $controller): void;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Automation\Engine\Integration;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\Automation\Engine\Data\Filter as FilterData;
|
||||
use MailPoet\Validator\Schema\ObjectSchema;
|
||||
|
||||
interface Filter {
|
||||
public function getFieldType(): string;
|
||||
|
||||
/** @return array<string, string> */
|
||||
public function getConditions(): array;
|
||||
|
||||
public function getArgsSchema(string $condition): ObjectSchema;
|
||||
|
||||
public function getFieldParams(FilterData $data): array;
|
||||
|
||||
/** @param mixed $value */
|
||||
public function matches(FilterData $data, $value): bool;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Automation\Engine\Integration;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
interface Payload {
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Automation\Engine\Integration;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\Automation\Engine\Data\StepValidationArgs;
|
||||
use MailPoet\Validator\Schema\ObjectSchema;
|
||||
|
||||
interface Step {
|
||||
public function getKey(): string;
|
||||
|
||||
public function getName(): string;
|
||||
|
||||
public function getArgsSchema(): ObjectSchema;
|
||||
|
||||
/** @return string[] */
|
||||
public function getSubjectKeys(): array;
|
||||
|
||||
public function validate(StepValidationArgs $args): void;
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Automation\Engine\Integration;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\Automation\Engine\Data\Field;
|
||||
use MailPoet\Automation\Engine\Data\Subject as SubjectData;
|
||||
use MailPoet\Validator\Schema\ObjectSchema;
|
||||
|
||||
/**
|
||||
* @template-covariant T of Payload
|
||||
*/
|
||||
interface Subject {
|
||||
public function getKey(): string;
|
||||
|
||||
public function getName(): string;
|
||||
|
||||
public function getArgsSchema(): ObjectSchema;
|
||||
|
||||
/** @return Field[] */
|
||||
public function getFields(): array;
|
||||
|
||||
/** @return T */
|
||||
public function getPayload(SubjectData $subjectData): Payload;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Automation\Engine\Integration;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\Automation\Engine\Data\Subject;
|
||||
|
||||
interface SubjectTransformer {
|
||||
public function transform(Subject $data): ?Subject;
|
||||
|
||||
public function returns(): string;
|
||||
|
||||
public function accepts(): string;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Automation\Engine\Integration;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\Automation\Engine\Data\StepRunArgs;
|
||||
|
||||
interface Trigger extends Step {
|
||||
public function registerHooks(): void;
|
||||
|
||||
public function isTriggeredBy(StepRunArgs $args): bool;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php declare(strict_types = 1);
|
||||
|
||||
namespace MailPoet\Automation\Engine\Integration;
|
||||
|
||||
if (!defined('ABSPATH')) exit;
|
||||
|
||||
|
||||
use MailPoet\Automation\Engine\Exceptions\UnexpectedValueException;
|
||||
|
||||
class ValidationException extends UnexpectedValueException {
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<?php
|
||||
Reference in New Issue
Block a user