php-github-api
php-github-api copied to clipboard
Fix type error in ResultPager::fetch
When using etags, the reply from github may be empty and the underlying APIs will return an empty string. We need to flip those to empty arrays. e.g.:
$github_builder
->addPlugin(new Http\Client\Common\Plugin\HeaderSetPlugin([
'If-None-Match' => $etag,
]));
$api = $github_client->user('user');
$paginator = new \Github\ResultPager($github_client);
$data = $paginator->fetch($api, 'events', [$username]);
// $data should be [] if $etag is the latest
added tests + redone the fix based on the fix committed for #1135
Thank you @nunoplopes