1 | <?php |
||
19 | class Reference implements Countable { |
||
20 | |||
21 | /** |
||
22 | * @var SnakList |
||
23 | */ |
||
24 | private $snaks; |
||
25 | |||
26 | /** |
||
27 | * An array of Snak objects is only supported since version 1.1. |
||
28 | * |
||
29 | * @param Snak[]|SnakList $snaks |
||
30 | * @throws InvalidArgumentException |
||
31 | */ |
||
32 | public function __construct( $snaks = [] ) { |
||
43 | |||
44 | 10 | /** |
|
45 | 10 | * Returns the property snaks that make up this reference. |
|
46 | * Modification of the snaks should NOT happen through this getter. |
||
47 | * |
||
48 | * @since 0.1 |
||
49 | * |
||
50 | * @return SnakList |
||
51 | */ |
||
52 | public function getSnaks() { |
||
55 | 7 | ||
56 | 7 | /** |
|
57 | * @see Countable::count |
||
58 | * |
||
59 | * @since 0.3 |
||
60 | * |
||
61 | * @return integer |
||
62 | */ |
||
63 | public function count() { |
||
66 | |||
67 | /** |
||
68 | * @since 2.6 |
||
69 | * |
||
70 | * @return bool |
||
71 | */ |
||
72 | public function isEmpty() { |
||
75 | 1 | ||
76 | 1 | /** |
|
77 | * @since 0.1 |
||
78 | * |
||
79 | * @return string |
||
80 | */ |
||
81 | public function getHash() { |
||
91 | |||
92 | 12 | /** |
|
93 | * |
||
94 | 12 | * The comparison is done purely value based, ignoring the order of the snaks. |
|
95 | * |
||
96 | * @since 0.3 |
||
97 | * |
||
98 | * @param mixed $target |
||
99 | * |
||
100 | * @return bool |
||
101 | */ |
||
102 | public function equals( $target ) { |
||
110 | 1 | ||
111 | } |
||
112 |