Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | namespace MobileFrontend\Features; |
4 | |
5 | /** |
6 | * Represents single mobile feature |
7 | * |
8 | * @package MobileFrontend\Features |
9 | * @codeCoverageIgnore |
10 | */ |
11 | interface IFeature { |
12 | |
13 | /** |
14 | * Beta mode defined in config |
15 | */ |
16 | public const CONFIG_BETA = 'beta'; |
17 | |
18 | /** |
19 | * Stable mode defined in config |
20 | */ |
21 | public const CONFIG_STABLE = 'base'; |
22 | |
23 | /** |
24 | * Get the feature id |
25 | * Used as a identifier in forms, database etc. Should be unique |
26 | * |
27 | * @return string |
28 | */ |
29 | public function getId(); |
30 | |
31 | /** |
32 | * Get the feature group |
33 | * @return string |
34 | */ |
35 | public function getGroup(); |
36 | |
37 | /** |
38 | * Serialise the feature as a string so that the feature manager can perform array_diff |
39 | * and array_intersect on results and identify where features are available and where they are not. |
40 | * This should return the value of getId. |
41 | * @return string |
42 | */ |
43 | public function __toString(); |
44 | |
45 | /** |
46 | * Check feature availability in given user mode ( base, beta, alpha etc ) |
47 | * @param IUserMode $mode UserMode |
48 | * @return bool |
49 | */ |
50 | public function isAvailable( IUserMode $mode ); |
51 | |
52 | /** |
53 | * The feature name defined as a translation tag |
54 | * ex: mobile-frontend-mobile-option-MFConfigFlag |
55 | * @return string |
56 | */ |
57 | public function getNameKey(); |
58 | |
59 | /** |
60 | * The feature name defined as a translation tag, |
61 | * ex: mobile-frontend-mobile-option-MFConfigFlag-description |
62 | * @return string |
63 | */ |
64 | public function getDescriptionKey(); |
65 | |
66 | } |