-
-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ResultPager cannot unpack array with string keys #798
Comments
The works fine (for me at least) on PHP 8.3. I believe this is the version number with the prefixed caret that allows me to use PHP 8.3. Basically means I can use anything from PHP 8.0.2 up until (but not including) a hypothetical PHP 9.0. So, if your project supports it, you could use PHP 8.1 just fine. |
That is correct, the issue is not with PHP >= 8.1 but instead with the fact that this package advertises itself as compatible with |
Agreed. @GrahamCampbell, I have fixed this in #800, if you agree to this change. |
The code sample is incorrect.
should be
|
The array needs to be the list of params. The first param is an array, but you are passing the first param, instead of a list of params. |
While I don't find it intuitive, it works! Thank you. |
ResultPager functions as expected unless I try to pass an array of parameters to
fetchAll()
. Using PHP 7.4.33 and m4tthumphrey/php-gitlab-api version 11.13.0.This works as-expected:
This throws an error copy/pasted below the code:
PHP Fatal error: Uncaught Error: Cannot unpack array with string keys in /path/to/app/vendor/m4tthumphrey/php-gitlab-api/src/ResultPager.php:93
Stack trace:
#0 /path/to/app/vendor/m4tthumphrey/php-gitlab-api/src/ResultPager.php(134): Gitlab\ResultPager->fetch(Object(Gitlab\Api\Projects), 'all', Array)
Line 93 in GitLab\ResultPager:
$result = self::bindPerPage($api, $this->perPage)->$method(...$parameters);
If my Googling is correct, unpacking an array with string keys was not allowed until PHP 8.1 but the current version (11.13.0) requires
php: ^7.4.15 || ^8.0.2
. Please correct me if I'm looking at this all wrong.The text was updated successfully, but these errors were encountered: