46
46
use const PHP_INT_MAX ;
47
47
48
48
use function property_exists ;
49
-
50
- use ReturnTypeWillChange ;
51
-
52
49
use function sprintf ;
53
50
54
51
use UnexpectedValueException ;
@@ -362,8 +359,7 @@ public function each(callable $callable): self
362
359
return $ this ;
363
360
}
364
361
365
- #[ReturnTypeWillChange]
366
- public function offsetGet ($ offset )
362
+ public function offsetGet (mixed $ offset ): mixed
367
363
{
368
364
while (!array_key_exists ($ offset , $ this ->cache ) && $ this ->valid ()) {
369
365
$ this ->next ();
@@ -376,12 +372,12 @@ public function offsetGet($offset)
376
372
return $ this ->cache [$ offset ];
377
373
}
378
374
379
- public function offsetSet ($ offset , $ value ): void
375
+ public function offsetSet (mixed $ offset , mixed $ value ): void
380
376
{
381
377
throw new BadMethodCallException (sprintf ('%s is immutable ' , static ::class));
382
378
}
383
379
384
- public function offsetUnset ($ offset ): void
380
+ public function offsetUnset (mixed $ offset ): void
385
381
{
386
382
throw new BadMethodCallException (sprintf ('%s is immutable ' , static ::class));
387
383
}
@@ -391,7 +387,7 @@ public function offsetUnset($offset): void
391
387
*
392
388
* @psalm-suppress UnusedForeachValue
393
389
*/
394
- public function offsetExists ($ offset ): bool
390
+ public function offsetExists (mixed $ offset ): bool
395
391
{
396
392
while (!array_key_exists ($ offset , $ this ->cache ) && $ this ->valid ()) {
397
393
$ this ->next ();
@@ -400,8 +396,7 @@ public function offsetExists($offset): bool
400
396
return array_key_exists ($ offset , $ this ->cache );
401
397
}
402
398
403
- #[ReturnTypeWillChange]
404
- public function jsonSerialize ()
399
+ public function jsonSerialize (): mixed
405
400
{
406
401
return $ this ->toArray ();
407
402
}
@@ -442,8 +437,7 @@ final public function count(): int
442
437
/**
443
438
* @return TValue
444
439
*/
445
- #[ReturnTypeWillChange]
446
- public function current ()
440
+ public function current (): mixed
447
441
{
448
442
$ this ->setupCache ();
449
443
@@ -485,8 +479,7 @@ public function next(): void
485
479
/**
486
480
* @return TKey
487
481
*/
488
- #[ReturnTypeWillChange]
489
- public function key ()
482
+ public function key (): mixed
490
483
{
491
484
return $ this ->cacheKey ();
492
485
}
0 commit comments