1 | <?php |
||
49 | class ItemList implements ItemListInterface |
||
50 | { |
||
51 | /** |
||
52 | * Items |
||
53 | * |
||
54 | * @var ItemInterface[] |
||
55 | */ |
||
56 | protected $items; |
||
57 | |||
58 | /** |
||
59 | * Internal pointer |
||
60 | * |
||
61 | * @var int |
||
62 | */ |
||
63 | protected $pointer; |
||
64 | |||
65 | /** |
||
66 | * ItemList constructor |
||
67 | * |
||
68 | * @param ItemInterface[] $items Items |
||
69 | * @api |
||
70 | */ |
||
71 | 16 | public function __construct(array $items = []) |
|
76 | |||
77 | /** |
||
78 | * Return the current item |
||
79 | * |
||
80 | * @return ItemInterface Item |
||
81 | * @api |
||
82 | */ |
||
83 | 2 | public function current() |
|
87 | |||
88 | /** |
||
89 | * Move forward to next element |
||
90 | * |
||
91 | * @return void |
||
92 | * @api |
||
93 | */ |
||
94 | 2 | public function next() |
|
98 | |||
99 | /** |
||
100 | * Return the position of the current element |
||
101 | * |
||
102 | * @return int Position of the current element |
||
103 | * @api |
||
104 | */ |
||
105 | 1 | public function key() |
|
109 | |||
110 | /** |
||
111 | * Checks if current position is valid |
||
112 | * |
||
113 | * @return boolean The current position is valid |
||
114 | * @api |
||
115 | */ |
||
116 | 2 | public function valid() |
|
120 | |||
121 | /** |
||
122 | * Rewind the item list to the first element |
||
123 | * |
||
124 | * @return void |
||
125 | * @api |
||
126 | */ |
||
127 | 2 | public function rewind() |
|
131 | |||
132 | /** |
||
133 | * Test if an offset exists |
||
134 | * |
||
135 | * @param int $offset Offset |
||
136 | */ |
||
137 | public function offsetExists($offset) |
||
141 | |||
142 | /** |
||
143 | * Return the item at a particular offset |
||
144 | * |
||
145 | * @param int $offset Offset |
||
146 | * @return ItemInterface Item |
||
147 | */ |
||
148 | 3 | public function offsetGet($offset) |
|
152 | |||
153 | /** |
||
154 | * Set an item at a particular offset |
||
155 | * |
||
156 | * @param int $offset Offset |
||
157 | * @param ItemInterface $value Item |
||
158 | */ |
||
159 | 1 | public function offsetSet($offset, $value) |
|
163 | |||
164 | /** |
||
165 | * Delete an item at a particular offset |
||
166 | * |
||
167 | * @param int $offset Offset |
||
168 | * @param ItemInterface $value Item |
||
|
|||
169 | */ |
||
170 | 1 | public function offsetUnset($offset) |
|
174 | |||
175 | /** |
||
176 | * Return an object representation of the item list |
||
177 | * |
||
178 | * @return \stdClass Micro information items |
||
179 | * @api |
||
180 | */ |
||
181 | 1 | public function toObject() |
|
191 | |||
192 | /** |
||
193 | * Return the first item, optionally of particular types |
||
194 | * |
||
195 | * @param array ...$types Item types |
||
196 | * @return ItemInterface Item |
||
197 | * @throws OutOfBoundsException If there are no matching items |
||
198 | * @api |
||
199 | */ |
||
200 | 2 | public function getFirstItem(...$types) |
|
214 | |||
215 | /** |
||
216 | * Return all items as an array, optionally filtered by item type(s) |
||
217 | * |
||
218 | * @param array ...$types Item types |
||
219 | * @return ItemInterface[] Items matching the requested types |
||
220 | * @api |
||
221 | */ |
||
222 | 6 | public function getItems(...$types) |
|
236 | |||
237 | /** |
||
238 | * Return the number of items in this list |
||
239 | * |
||
240 | * @return int Number of items |
||
241 | * @api |
||
242 | */ |
||
243 | 2 | public function count() |
|
247 | |||
248 | /** |
||
249 | * Generic item getter |
||
250 | * |
||
251 | * @param string $type Item type |
||
252 | * @param array $arguments Arguments |
||
253 | * @return ItemInterface Item |
||
254 | * @throws InvalidArgumentException If the item index is invalid |
||
255 | * @api |
||
256 | */ |
||
257 | 2 | public function __call($type, $arguments) |
|
275 | |||
276 | /** |
||
277 | * Return an item by type and index |
||
278 | * |
||
279 | * @param string $type Item type |
||
280 | * @param int $index Item index |
||
281 | * @return ItemInterface Item |
||
282 | * @throws OutOfBoundsException If the item index is out of bounds |
||
283 | */ |
||
284 | 2 | protected function getItemByTypeAndIndex($type, $index) |
|
298 | } |
||
299 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.