KnpLabs / KnpLabs/php-github-api

ResultPager::get() can return string

Abierto
#1,091 4 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
PHP
Estrellas
2.2k
Forks
587
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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!

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
php
Área
api
Tipo de issue
Error
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.