KnpLabs / KnpLabs/php-github-api

ResultPager::get() can return string

オープン
#1,091 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
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

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。