| 1 | <?php |
||
| 13 | class StandardVariation implements VariationInterface { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @var array |
||
| 17 | */ |
||
| 18 | protected $variation; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param array $variation eg array('name' => 'blueColor', 'percentage' => 50). |
||
| 22 | * A name has to be given and can be also an ID, eg "4". Percentage is optional. |
||
| 23 | * If given, it defines how much traffic this variation should get. For example defining |
||
| 24 | * 50 means, this variation will be activated in 50% of overall experiment activations. |
||
| 25 | * |
||
| 26 | * @throws InvalidArgumentException If no variation is given |
||
| 27 | */ |
||
| 28 | 19 | public function __construct($variation) |
|
| 36 | |||
| 37 | /** |
||
| 38 | * @inheritdoc |
||
| 39 | */ |
||
| 40 | 10 | public function getName() |
|
| 44 | |||
| 45 | /** |
||
| 46 | * @inheritdoc |
||
| 47 | */ |
||
| 48 | 2 | public function getPercentage() |
|
| 54 | |||
| 55 | /** |
||
| 56 | * @inheritdoc |
||
| 57 | */ |
||
| 58 | public function run() |
||
| 64 | |||
| 65 | } |