Tustin / psn-php

A PHP wrapper for the PSN API
https://tustin.dev/psn-php/
MIT License
358 stars 74 forks source link

Offset 128 does not exist #241

Open stipey opened 1 year ago

stipey commented 1 year ago

Hi.

I've recently started getting the following error:

Uncaught InvalidArgumentException: Offset 128 does not exist in /vendor/tustin/psn-php/src/Iterator/AbstractApiIterator.php:132 Stack trace: #0 /vendor/tustin/psn-php/src/Iterator/UsersSearchIterator.php(53): Tustin\PlayStation\Iterator\AbstractApiIterator->getFromOffset(128) #1 Tustin\PlayStation\Iterator\UsersSearchIterator->current() #2 {main} thrown in /vendor/tustin/psn-php/src/Iterator/AbstractApiIterator.php on line 132

Anyone familiar with the cause of this and how to remedy it?

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

owendswang commented 1 year ago

This problem remains. Tested on v3.0.4 and v4.0.0.

$query = $client -> users() -> search('tustin');
foreach ($query as $item) {
  print(var_dump($item -> onlineid()));
}

Then the error occurs after several iterates.

PHP Fatal error:  Uncaught InvalidArgumentException: Offset 128 does not exist. in /root/psn_php_v4/vendor/tustin/psn-php/src/Iterator/AbstractApiIterator.php:156
Stack trace:
#0 /root/psn_php_v4/vendor/tustin/psn-php/src/Iterator/UsersSearchIterator.php(73): Tustin\PlayStation\Iterator\AbstractApiIterator->getFromOffset()
#1 /root/psn_php_v4/test.php(17): Tustin\PlayStation\Iterator\UsersSearchIterator->current()
#2 {main}
  thrown in /root/psn_php_v4/vendor/tustin/psn-php/src/Iterator/AbstractApiIterator.php on line 156