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