@@ -255,8 +255,7 @@ public function toArray($associative = true, ...$keys): array
255
255
*
256
256
* @since 1.0
257
257
*/
258
- #[\ReturnTypeWillChange]
259
- public function count ()
258
+ public function count (): int
260
259
{
261
260
return \count ($ this ->objects );
262
261
}
@@ -268,7 +267,7 @@ public function count()
268
267
*
269
268
* @since 1.0
270
269
*/
271
- public function clear ()
270
+ public function clear (): DataSet
272
271
{
273
272
$ this ->objects = [];
274
273
$ this ->rewind ();
@@ -279,12 +278,11 @@ public function clear()
279
278
/**
280
279
* Get the current data object in the set.
281
280
*
282
- * @return DataObject|false The current object, or false if the array is empty or the pointer is beyond the end of the elements.
281
+ * @return DataObject|bool The current object, or false if the array is empty or the pointer is beyond the end of the elements.
283
282
*
284
283
* @since 1.0
285
284
*/
286
- #[\ReturnTypeWillChange]
287
- public function current ()
285
+ public function current (): DataObject |bool
288
286
{
289
287
return is_scalar ($ this ->current ) ? $ this ->objects [$ this ->current ] : false ;
290
288
}
@@ -351,12 +349,11 @@ public function jsonSerialize(): array
351
349
/**
352
350
* Gets the key of the current object in the iterator.
353
351
*
354
- * @return integer|false The object key on success; false on failure.
352
+ * @return int|bool|null The object key on success; false on failure.
355
353
*
356
354
* @since 1.0
357
355
*/
358
- #[\ReturnTypeWillChange]
359
- public function key ()
356
+ public function key (): int |bool |null
360
357
{
361
358
return $ this ->current ;
362
359
}
@@ -399,8 +396,7 @@ public function walk(callable $funcname): bool
399
396
*
400
397
* @since 1.0
401
398
*/
402
- #[\ReturnTypeWillChange]
403
- public function next ()
399
+ public function next (): void
404
400
{
405
401
// Get the object offsets.
406
402
$ keys = $ this ->keys ();
@@ -433,8 +429,7 @@ public function next()
433
429
*
434
430
* @since 1.0
435
431
*/
436
- #[\ReturnTypeWillChange]
437
- public function offsetExists ($ offset )
432
+ public function offsetExists ($ offset ): bool
438
433
{
439
434
return isset ($ this ->objects [$ offset ]);
440
435
}
@@ -448,8 +443,7 @@ public function offsetExists($offset)
448
443
*
449
444
* @since 1.0
450
445
*/
451
- #[\ReturnTypeWillChange]
452
- public function offsetGet ($ offset )
446
+ public function offsetGet ($ offset ): DataObject |null
453
447
{
454
448
return $ this ->objects [$ offset ] ?? null ;
455
449
}
@@ -465,8 +459,7 @@ public function offsetGet($offset)
465
459
* @since 1.0
466
460
* @throws \InvalidArgumentException if an object is not an instance of DataObject.
467
461
*/
468
- #[\ReturnTypeWillChange]
469
- public function offsetSet ($ offset , $ object )
462
+ public function offsetSet ($ offset , $ object ): void
470
463
{
471
464
if (!($ object instanceof DataObject)) {
472
465
throw new \InvalidArgumentException (
@@ -495,8 +488,7 @@ public function offsetSet($offset, $object)
495
488
*
496
489
* @since 1.0
497
490
*/
498
- #[\ReturnTypeWillChange]
499
- public function offsetUnset ($ offset )
491
+ public function offsetUnset ($ offset ): void
500
492
{
501
493
if (!isset ($ this [$ offset ])) {
502
494
// Do nothing if the offset does not exist.
@@ -529,8 +521,7 @@ public function offsetUnset($offset)
529
521
*
530
522
* @since 1.0
531
523
*/
532
- #[\ReturnTypeWillChange]
533
- public function rewind ()
524
+ public function rewind (): void
534
525
{
535
526
// Set the current position to the first object.
536
527
if (empty ($ this ->objects )) {
@@ -548,8 +539,7 @@ public function rewind()
548
539
*
549
540
* @since 1.0
550
541
*/
551
- #[\ReturnTypeWillChange]
552
- public function valid ()
542
+ public function valid (): bool
553
543
{
554
544
// Check the current position.
555
545
if (!is_scalar ($ this ->current ) || !isset ($ this ->objects [$ this ->current ])) {
0 commit comments