1 | <?php |
||
7 | class StandardChance implements Chance |
||
8 | { |
||
9 | private $generator; |
||
10 | |||
11 | private $percentage = 100; |
||
12 | |||
13 | /** |
||
14 | * StandardChance constructor. |
||
15 | * @param Generator|null $generator |
||
16 | */ |
||
17 | public function __construct(Generator $generator = null) |
||
25 | |||
26 | /** |
||
27 | * Determine whether or not the experiment should run |
||
28 | */ |
||
29 | public function shouldRun() |
||
39 | |||
40 | /** |
||
41 | * @return int |
||
42 | */ |
||
43 | public function getPercentage() |
||
47 | |||
48 | /** |
||
49 | * @param int $percentage |
||
50 | * @return $this |
||
51 | */ |
||
52 | public function setPercentage($percentage) |
||
57 | } |
||
58 |