1 | <?php |
||
20 | class Bag |
||
21 | { |
||
22 | /** |
||
23 | * The test to execute. |
||
24 | * |
||
25 | * @var TestInterface |
||
26 | */ |
||
27 | private $test; |
||
28 | |||
29 | /** |
||
30 | * The options for this test. |
||
31 | * |
||
32 | * @var array |
||
33 | */ |
||
34 | private $options; |
||
35 | |||
36 | /** |
||
37 | * The participation filter that checks if a guest should participate in the test. |
||
38 | * |
||
39 | * @var FilterInterface |
||
40 | */ |
||
41 | private $participationFilter; |
||
42 | |||
43 | /** |
||
44 | * The variant chooser that decides which variant of the test to use. |
||
45 | * |
||
46 | * @var ChooserInterface |
||
47 | */ |
||
48 | private $variantChooser; |
||
49 | |||
50 | /** |
||
51 | * Initializes a new instance of this class. |
||
52 | * |
||
53 | * @param TestInterface $test The test |
||
54 | * @param FilterInterface $participationFilter |
||
55 | * @param ChooserInterface $variantChooser |
||
56 | * @param array $options Additional options |
||
57 | */ |
||
58 | 23 | public function __construct( |
|
69 | |||
70 | /** |
||
71 | * Get the Test from the Bag |
||
72 | * |
||
73 | * @return TestInterface |
||
74 | */ |
||
75 | 14 | public function getTest() |
|
79 | |||
80 | /** |
||
81 | * Get all Options for the Test. |
||
82 | * |
||
83 | * Options can be used for data which is not mandatory and |
||
84 | * can be Implementation specific. Like Google-Experiments ID |
||
85 | * |
||
86 | * @return array |
||
87 | */ |
||
88 | 2 | public function getOptions() |
|
92 | |||
93 | /** |
||
94 | * Get the Participation Strategy |
||
95 | * |
||
96 | * @return FilterInterface |
||
97 | */ |
||
98 | 6 | public function getParticipationFilter() |
|
102 | |||
103 | /** |
||
104 | * Get the Variant Chooser. |
||
105 | * |
||
106 | * The Variant Chooser chooses the variant after the |
||
107 | * Strategy allowed the user to participate in the test. |
||
108 | * |
||
109 | * @return ChooserInterface |
||
110 | */ |
||
111 | 5 | public function getVariantChooser() |
|
115 | } |
||
116 |