1 | <?php |
||
19 | class ItemIdSet implements IteratorAggregate, Countable { |
||
20 | |||
21 | /** |
||
22 | * @var ItemId[] |
||
23 | */ |
||
24 | private $ids = []; |
||
25 | |||
26 | /** |
||
27 | * @param ItemId[] $ids |
||
28 | * |
||
29 | * @throws InvalidArgumentException |
||
30 | */ |
||
31 | public function __construct( array $ids = [] ) { |
||
40 | 14 | ||
41 | 14 | /** |
|
42 | * @see Countable::count |
||
43 | * |
||
44 | * @return int |
||
45 | */ |
||
46 | public function count() { |
||
49 | 2 | ||
50 | /** |
||
51 | * @see IteratorAggregate::getIterator |
||
52 | * |
||
53 | * @return Iterator|ItemId[] |
||
54 | */ |
||
55 | public function getIterator() { |
||
58 | 3 | ||
59 | /** |
||
60 | * @since 2.5 |
||
61 | * |
||
62 | * @return string[] |
||
63 | */ |
||
64 | public function getSerializations() { |
||
74 | 3 | ||
75 | /** |
||
76 | * @param ItemId $id |
||
77 | * |
||
78 | * @return bool |
||
79 | */ |
||
80 | public function has( ItemId $id ) { |
||
83 | 2 | ||
84 | /** |
||
85 | * @see Countable::equals |
||
86 | * |
||
87 | * @since 0.1 |
||
88 | * |
||
89 | * @param mixed $target |
||
90 | * |
||
91 | * @return bool |
||
92 | */ |
||
93 | public function equals( $target ) { |
||
101 | 7 | ||
102 | } |
||
103 |