@@ -177,17 +177,18 @@ public function toArray()
177
177
* @return void
178
178
* @uses $iteratorPosition set to 0
179
179
*/
180
- public function rewind ()
180
+ public function rewind (): void
181
181
{
182
182
$ this ->iteratorPosition = 0 ;
183
183
}
184
184
185
185
/**
186
186
* Get Iterator's current {@link CFType} identified by {@link $iteratorPosition}
187
187
* @link http://php.net/manual/en/iterator.current.php
188
- * @return CFType current Item
188
+ * @return mixed current Item
189
189
* @uses $iteratorPosition identify current key
190
190
*/
191
+ #[\ReturnTypeWillChange]
191
192
public function current ()
192
193
{
193
194
return $ this ->value [$ this ->iteratorPosition ];
@@ -196,9 +197,10 @@ public function current()
196
197
/**
197
198
* Get Iterator's current key identified by {@link $iteratorPosition}
198
199
* @link http://php.net/manual/en/iterator.key.php
199
- * @return string key of the current Item
200
+ * @return mixed key of the current Item: mixed
200
201
* @uses $iteratorPosition identify current key
201
202
*/
203
+ #[\ReturnTypeWillChange]
202
204
public function key ()
203
205
{
204
206
return $ this ->iteratorPosition ;
@@ -210,19 +212,19 @@ public function key()
210
212
* @return void
211
213
* @uses $iteratorPosition increment by 1
212
214
*/
213
- public function next ()
215
+ public function next (): void
214
216
{
215
217
$ this ->iteratorPosition ++;
216
218
}
217
219
218
220
/**
219
221
* Test if {@link $iteratorPosition} addresses a valid element of {@link $value}
220
222
* @link http://php.net/manual/en/iterator.valid.php
221
- * @return boolean true if current position is valid, false else
223
+ * @return bool true if current position is valid, false else
222
224
* @uses $iteratorPosition test if within {@link $iteratorKeys}
223
225
* @uses $iteratorPosition test if within {@link $value}
224
226
*/
225
- public function valid ()
227
+ public function valid (): bool
226
228
{
227
229
return isset ($ this ->value [$ this ->iteratorPosition ]);
228
230
}
@@ -233,53 +235,54 @@ public function valid()
233
235
234
236
/**
235
237
* Determine if the array's key exists
236
- * @param string $key the key to check
238
+ * @param string $offset the key to check
237
239
* @return bool true if the offset exists, false if not
238
240
* @link http://php.net/manual/en/arrayaccess.offsetexists.php
239
241
* @uses $value to check if $key exists
240
242
* @author Sean Coates <[email protected] >
241
243
*/
242
- public function offsetExists ($ key )
244
+ public function offsetExists ($ offset ): bool
243
245
{
244
- return isset ($ this ->value [$ key ]);
246
+ return isset ($ this ->value [$ offset ]);
245
247
}
246
248
247
249
/**
248
250
* Fetch a specific key from the CFArray
249
- * @param string $key the key to check
251
+ * @param mixed $offset the key to check
250
252
* @return mixed the value associated with the key; null if the key is not found
251
253
* @link http://php.net/manual/en/arrayaccess.offsetget.php
252
254
* @uses get() to get the key's value
253
255
* @author Sean Coates <[email protected] >
254
256
*/
255
- public function offsetGet ($ key )
257
+ #[\ReturnTypeWillChange]
258
+ public function offsetGet ($ offset )
256
259
{
257
- return $ this ->get ($ key );
260
+ return $ this ->get ($ offset );
258
261
}
259
262
260
263
/**
261
264
* Set a value in the array
262
- * @param string $key the key to set
263
- * @param string $value the value to set
265
+ * @param mixed $offset the key to set
266
+ * @param mixed $value the value to set
264
267
* @return void
265
268
* @link http://php.net/manual/en/arrayaccess.offsetset.php
266
269
* @uses setValue() to set the key's new value
267
270
* @author Sean Coates <[email protected] >
268
271
*/
269
- public function offsetSet ($ key , $ value )
272
+ public function offsetSet ($ offset , $ value ): void
270
273
{
271
- return $ this ->setValue ($ value );
274
+ $ this ->setValue ($ value );
272
275
}
273
276
274
277
/**
275
278
* Unsets a value in the array
276
279
* <b>Note:</b> this dummy does nothing
277
- * @param string $key the key to set
280
+ * @param mixed $offset the key to set
278
281
* @return void
279
282
* @link http://php.net/manual/en/arrayaccess.offsetunset.php
280
283
* @author Sean Coates <[email protected] >
281
284
*/
282
- public function offsetUnset ($ key )
285
+ public function offsetUnset ($ offset ): void
283
286
{
284
287
}
285
288
}
0 commit comments