1 | <?php |
||
49 | class ImageCandidateSet implements ImageCandidateSetInterface |
||
50 | { |
||
51 | /** |
||
52 | * Image candidates |
||
53 | * |
||
54 | * @var ImageCandidateInterface[] |
||
55 | */ |
||
56 | protected $imageCandidates = []; |
||
57 | /** |
||
58 | * Internal pointer |
||
59 | * |
||
60 | * @var int |
||
61 | */ |
||
62 | protected $pointer = 0; |
||
63 | |||
64 | /** |
||
65 | * Return the current image candidate |
||
66 | * |
||
67 | * @return ImageCandidateInterface Image candidate |
||
68 | */ |
||
69 | 1 | public function current(): ImageCandidateInterface |
|
73 | |||
74 | /** |
||
75 | * Move forward to next image candidate |
||
76 | * |
||
77 | * @return void |
||
78 | */ |
||
79 | 1 | public function next(): void |
|
83 | |||
84 | /** |
||
85 | * Return the key of the current image candidate |
||
86 | * |
||
87 | * @return int Current key |
||
88 | */ |
||
89 | 1 | public function key(): int |
|
93 | |||
94 | /** |
||
95 | * Checks if current position is valid |
||
96 | * |
||
97 | * @return boolean The return value will be casted to boolean and then evaluated. |
||
98 | */ |
||
99 | 1 | public function valid(): bool |
|
103 | |||
104 | /** |
||
105 | * Rewind the Iterator to the first element |
||
106 | * |
||
107 | * @return void |
||
108 | */ |
||
109 | 1 | public function rewind(): void |
|
113 | |||
114 | /** |
||
115 | * Whether a offset exists |
||
116 | * |
||
117 | * @param int $offset Offset |
||
118 | * |
||
119 | * @return boolean Offset exists |
||
120 | */ |
||
121 | 1 | public function offsetExists($offset): bool |
|
125 | |||
126 | /** |
||
127 | * Offset to retrieve |
||
128 | * |
||
129 | * @param int $offset Offset |
||
130 | * |
||
131 | * @return ImageCandidateInterface Image candidate |
||
132 | */ |
||
133 | 1 | public function offsetGet($offset): ImageCandidateInterface |
|
137 | |||
138 | /** |
||
139 | * Offset to set |
||
140 | * |
||
141 | * @param int $offset Offset |
||
142 | * @param ImageCandidateInterface $value |
||
143 | * |
||
144 | * @return void |
||
145 | * @throws InvalidArgumentException If the value given is not a valid image candidate |
||
146 | */ |
||
147 | 4 | public function offsetSet($offset, $value): void |
|
158 | |||
159 | /** |
||
160 | * Offset to unset |
||
161 | * |
||
162 | * @param int $offset Offset |
||
163 | * |
||
164 | * @return void |
||
165 | */ |
||
166 | 1 | public function offsetUnset($offset): void |
|
171 | |||
172 | /** |
||
173 | * Count elements of an object |
||
174 | * |
||
175 | * @return int Number of registered image candidates |
||
176 | */ |
||
177 | 2 | public function count() |
|
181 | } |