KnpLabs / KnpLabs/php-github-api
ResultPager::get() can return string
- Dominant language
- PHP
- Stars
- 2.2k
- Forks
- 587
- PR merge metrics
- No merged PRs in 30d
Description
Because `ResultPager::get()` [here](https://github.com/KnpLabs/php-github-api/blob/master/lib/Github/ResultPager.php#L205) returns the return value of [`ResponseMediator::getContent()`](https://github.com/KnpLabs/php-github-api/blob/master/lib/Github/HttpClient/Message/ResponseMediator.php#L11-L26), it can occasionally return a string, which causes an unhelpful TypeError since it should only ever return an array. Other usages of `ResponseMediator::getContent()` allow for this, but the `ResultPager` one does not.
This has been occurring in practice to us so figured I'd raise it here - let me know any other information you need on this issue, it is my first one!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in lib/Github/ResultPager.php at ResultPager::get() and compare its use of ResponseMediator::getContent() with the behavior described in lib/Github/HttpClient/Message/ResponseMediator.php. Confirm the method consistently returns an array, add coverage for the string-content case, and verify the resulting TypeError no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100