Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
BetaUserMode | |
0.00% |
0 / 3 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
isEnabled | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getModeIdentifier | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace MobileFrontend\Features; |
4 | |
5 | /** |
6 | * Temporary class to provide a bridge between old Beta mode handling and new Feature management |
7 | * system. |
8 | * |
9 | * Beta mode will be refactored properly in T212802, for now we need an easy way to retrieve |
10 | * information about beta mode. |
11 | * |
12 | * IMPORTANT: This class provides read-only state, if you want to enable/disable beta mode |
13 | * please use MobileContext classes |
14 | * |
15 | * @package MobileFrontend\Features |
16 | */ |
17 | class BetaUserMode implements IUserMode { |
18 | |
19 | /** |
20 | * @var \MobileContext |
21 | */ |
22 | private $context; |
23 | |
24 | /** |
25 | * @param \MobileContext $context Mobile context |
26 | */ |
27 | public function __construct( \MobileContext $context ) { |
28 | $this->context = $context; |
29 | } |
30 | |
31 | /** |
32 | * @inheritDoc |
33 | */ |
34 | public function isEnabled() { |
35 | return $this->context->isBetaGroupMember(); |
36 | } |
37 | |
38 | /** |
39 | * @inheritDoc |
40 | */ |
41 | public function getModeIdentifier() { |
42 | return IFeature::CONFIG_BETA; |
43 | } |
44 | } |