diff --git a/src/core/Ab/AbContainerInterface.php b/src/core/Ab/AbContainerInterface.php new file mode 100644 index 0000000..866b4fc --- /dev/null +++ b/src/core/Ab/AbContainerInterface.php @@ -0,0 +1,17 @@ + + */ +interface AbContainerInterface +{ + public function add(AbTestInterface $test): self; + + public function has(string $name): bool; + + public function get(string $name): AbTestInterface; +} diff --git a/src/core/Ab/AbTestInterface.php b/src/core/Ab/AbTestInterface.php new file mode 100644 index 0000000..051233e --- /dev/null +++ b/src/core/Ab/AbTestInterface.php @@ -0,0 +1,31 @@ + + */ +interface AbTestInterface +{ + public function getName(): string; + + public function getResult(); + + public function setResult(string $result): self; + + public function isValidVariation($variation): bool; + + public function addVariation(string $name, $value, int $probability = null): self; + + public function getVariation($variation); + + public function getResultValue(); + + public function setDuration(int $duration): self; + + public function getDuration(): int; + + public function run(): self; +}