Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
EntityTypesParameter | |
0.00% |
0 / 4 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
getEntityTypes | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getEntityTypeItemIds | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace WikibaseQuality\ConstraintReport\ConstraintCheck\Helper; |
4 | |
5 | use Wikibase\DataModel\Entity\ItemId; |
6 | |
7 | /** |
8 | * Wrapper class for a constraint parameter representing a list of entity types. |
9 | * |
10 | * @license GPL-2.0-or-later |
11 | * @author Lucas Werkmeister |
12 | */ |
13 | class EntityTypesParameter { |
14 | |
15 | /** |
16 | * @var string[] |
17 | */ |
18 | private $entityTypes; |
19 | |
20 | /** |
21 | * @var ItemId[] |
22 | */ |
23 | private $entityTypeItemIds; |
24 | |
25 | /** |
26 | * @param string[] $entityTypes The allowed entity types as strings. |
27 | * @param ItemId[] $entityTypeItemIds The item IDs of the allowed entity types. |
28 | */ |
29 | public function __construct( |
30 | array $entityTypes, |
31 | array $entityTypeItemIds |
32 | ) { |
33 | $this->entityTypes = $entityTypes; |
34 | $this->entityTypeItemIds = $entityTypeItemIds; |
35 | } |
36 | |
37 | /** |
38 | * @return string[] The allowed entity types as strings. |
39 | * @see EntityDocument::getType() |
40 | */ |
41 | public function getEntityTypes() { |
42 | return $this->entityTypes; |
43 | } |
44 | |
45 | /** |
46 | * @return ItemId[] The item IDs of the allowed entity types. |
47 | */ |
48 | public function getEntityTypeItemIds() { |
49 | return $this->entityTypeItemIds; |
50 | } |
51 | |
52 | } |