refactoring of ab classes
This commit is contained in:
parent
280f7f01b1
commit
d436f38668
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core\Ab;
|
||||
|
||||
/**
|
||||
* interface AbContainerInterface.
|
||||
*
|
||||
* @author Simon Vieille <simon@deblan.fr>
|
||||
*/
|
||||
interface AbContainerInterface
|
||||
{
|
||||
public function add(AbTestInterface $test): self;
|
||||
|
||||
public function has(string $name): bool;
|
||||
|
||||
public function get(string $name): AbTestInterface;
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
namespace App\Core\Ab;
|
||||
|
||||
/**
|
||||
* interface AbTestInterface.
|
||||
*
|
||||
* @author Simon Vieille <simon@deblan.fr>
|
||||
*/
|
||||
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;
|
||||
}
|
Loading…
Reference in New Issue