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 WikibaseQuality\ConstraintReport\ConstraintCheck\Context; |
4 | |
5 | /** |
6 | * A context cursor encapsulates the location |
7 | * where a check result serialization for a certain Context should be stored. |
8 | * |
9 | * @license GPL-2.0-or-later |
10 | */ |
11 | interface ContextCursor { |
12 | |
13 | /** |
14 | * The type of the associated context. |
15 | * |
16 | * @return string one of the Context::TYPE_* constants |
17 | */ |
18 | public function getType(); |
19 | |
20 | /** |
21 | * The ID of the entity of the associated context. |
22 | * |
23 | * @return string {@link EntityId::getSerialization() entity ID serialization} |
24 | */ |
25 | public function getEntityId(); |
26 | |
27 | /** |
28 | * The property ID of the main statement of the associated context. |
29 | * |
30 | * @return string {@link PropertyId::getSerialization() property ID serialization} |
31 | */ |
32 | public function getStatementPropertyId(); |
33 | |
34 | /** |
35 | * The GUID of the main statement of the associated context. |
36 | * |
37 | * @return string |
38 | */ |
39 | public function getStatementGuid(); |
40 | |
41 | /** |
42 | * The property ID serialization of the snak of the associated context. |
43 | * |
44 | * @return string |
45 | */ |
46 | public function getSnakPropertyId(); |
47 | |
48 | /** |
49 | * The hash of the snak of the associated context. |
50 | * |
51 | * @return string |
52 | */ |
53 | public function getSnakHash(); |
54 | |
55 | /** |
56 | * Store the check result serialization $result |
57 | * at the appropriate location for this context in $container. |
58 | * |
59 | * Mainly used in the API, where $container is part of the API response. |
60 | * |
61 | * If $result is null, don’t actually store it, |
62 | * but still populate the appropriate location for the context in $container |
63 | * (by creating all intermediate path elements of the location where $result would be stored). |
64 | * |
65 | * @param ?array $result |
66 | * @param array[] &$container |
67 | */ |
68 | public function storeCheckResultInArray( ?array $result, array &$container ); |
69 | |
70 | } |