Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
SimpleRequirement | |
0.00% |
0 / 4 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
getName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
isMet | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | /** |
4 | * This program is free software; you can redistribute it and/or modify |
5 | * it under the terms of the GNU General Public License as published by |
6 | * the Free Software Foundation; either version 2 of the License, or |
7 | * (at your option) any later version. |
8 | * |
9 | * This program is distributed in the hope that it will be useful, |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | * GNU General Public License for more details. |
13 | * |
14 | * You should have received a copy of the GNU General Public License along |
15 | * with this program; if not, write to the Free Software Foundation, Inc., |
16 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
17 | * http://www.gnu.org/copyleft/gpl.html |
18 | * |
19 | * @file |
20 | * @since 1.35 |
21 | */ |
22 | |
23 | namespace MediaWiki\Skins\Vector\FeatureManagement\Requirements; |
24 | |
25 | use MediaWiki\Skins\Vector\FeatureManagement\Requirement; |
26 | |
27 | /** |
28 | * NOTE: This API hasn't settled. It may change at any time without warning. Please don't bind to |
29 | * it unless you absolutely need to |
30 | * |
31 | * @unstable |
32 | * |
33 | * @package MediaWiki\Skins\Vector\FeatureManagement\Requirements |
34 | * @internal |
35 | */ |
36 | class SimpleRequirement implements Requirement { |
37 | |
38 | /** |
39 | * The name of the requirement |
40 | */ |
41 | private string $name; |
42 | |
43 | /** |
44 | * Whether the requirement is met |
45 | */ |
46 | private bool $isMet; |
47 | |
48 | /** |
49 | * @param string $name The name of the requirement |
50 | * @param bool $isMet Whether the requirement is met |
51 | */ |
52 | public function __construct( string $name, bool $isMet ) { |
53 | $this->name = $name; |
54 | $this->isMet = $isMet; |
55 | } |
56 | |
57 | /** |
58 | * @inheritDoc |
59 | */ |
60 | public function getName(): string { |
61 | return $this->name; |
62 | } |
63 | |
64 | /** |
65 | * @inheritDoc |
66 | */ |
67 | public function isMet(): bool { |
68 | return $this->isMet; |
69 | } |
70 | } |