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