murph-core/src/core/Ab/AbContainer.php
2022-05-20 13:50:04 +02:00

31 lines
485 B
PHP

<?php
namespace App\Core\Ab;
/**
* class AbContainer.
*
* @author Simon Vieille <simon@deblan.fr>
*/
class AbContainer
{
protected array $tests = [];
public function add(AbTest $test): self
{
$this->tests[$test->getName()] = $test;
return $this;
}
public function has(string $name): bool
{
return isset($this->tests[$name]);
}
public function get(string $name): AbTest
{
return $this->tests[$name];
}
}