KnpLabs / KnpLabs/php-github-api
ResultPager::get() can return string
- 主要语言
- PHP
- 星标
- 2.2k
- 派生
- 587
- PR 合并指标
- 30 天内没有已合并 PR
描述
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!
贡献指南
这个仓库没有索引到贡献指南
调研方向
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.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- php
- 领域
- api
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 45/100