Skip to content

allow to set the requested page on all endpoints #586

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

Merged
merged 3 commits into from
Nov 27, 2017
Merged

allow to set the requested page on all endpoints #586

merged 3 commits into from
Nov 27, 2017

Conversation

Gummibeer
Copy link
Contributor

At the moment it's not possible to request another page on all endpoints (search for example). With this change the requested page can be set the same way like the per_page.

At the moment it's not possible to request another page on all endpoints (search for example). With this change the requested `page` can be set the same way like the `per_page`.
Copy link
Collaborator

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many endpoints allow to specify a $param which allow pagination. See https://github.com/KnpLabs/php-github-api/blob/master/lib/Github/Api/CurrentUser.php#L179

*
* @var null|int
*/
protected $page;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not private?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same why $perPage isn't private - it should be extendable.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make $perPage private to if it didn't break BC.

It is easier to change from private to protected than the other way around.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping @Gummibeer, please change this property to private

@Gummibeer
Copy link
Contributor Author

@Nyholm yes, but by far not all - and I think there are two ways: define the page like in this PR or allow the $params array in every endpoint.

@Nyholm
Copy link
Collaborator

Nyholm commented May 10, 2017

I do like the idea of solving this for all apis.

Do all endpoints support pagination?

@Gummibeer
Copy link
Contributor Author

Every endpoint that returns more than one entry.

https://developer.github.com/v3/#pagination

@michalbundyra
Copy link

@Einenlum any chance to get it merged and released soon?
I'm struggling with getting all repositories for the specific user... I can get do it for org, but not for non-org user. Thanks!

@michalbundyra
Copy link

ping @acrobat

@acrobat
Copy link
Collaborator

acrobat commented Nov 24, 2017

Only a minor comment left, but after that it looks good to merge!

@acrobat acrobat closed this Nov 24, 2017
@acrobat acrobat reopened this Nov 24, 2017
@acrobat
Copy link
Collaborator

acrobat commented Nov 24, 2017

Sorry wrong button :(

@Gummibeer
Copy link
Contributor Author

Done

@cursedcoder
Copy link
Contributor

Sounds legit, opinion guys @Nyholm @acrobat ?

@acrobat
Copy link
Collaborator

acrobat commented Nov 27, 2017

Yes indeed! Last comments were fixed so merging! Thanks @Gummibeer!

@acrobat acrobat merged commit 9bd650e into KnpLabs:master Nov 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants