-
-
Notifications
You must be signed in to change notification settings - Fork 598
Added pagination support for PullRequest #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I implemented a small method to get all PR. Do you want I add this method to this PR: private function getAllPrs($organisazion, $repositoryName, $status = null)
{
$prApi = $this->client->api('pull_request');
$page = 1;
$prs = array();
do {
$prs = array_merge($prs, $prApi->all($organisazion, $repositoryName, $status, $page, 100));
$pagination = $this->client->getHttpClient()->getLastResponse()->getPagination();
$next = isset($pagination['next']) ? $pagination['next'] : false;
if (!$next) {
break;
}
$url = parse_url($next);
parse_str($url['query'], $qsa);
$page = $qsa['page'];
} while (true);
return $prs;
} Of cource, I will adapt the code ;) |
Seems like the implementation can be done more globally, since most github API's support pagination now. For most people who don't want to deal with pagination, it would be nice to have a global option to up the per-page param. I've got a github enterprise server, so rate limits are not an issue. I'm betting most won't want to deal with pagination regardless. |
Hello. I do not have to of time for this contribution. Sorry. |
And BTW, who is the current maintainer of this repository ? |
as it looks, whoever is the maintainer is not exactly active on this. i tried to get the attention of @KnpLabs on twitter and in github but so far no luck... |
but i propose you leave this PR open until the maintainer shows up and |
@pilot @cursedcoder Can you have a look at those? Thanks =) |
@stloyd does this applicable? |
Added pagination support for PullRequest
Made a better API than #44 and add tests