Skip to content
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

Add sort and direction for fetching organizations repos #863

Merged
merged 4 commits into from
Apr 20, 2020
Merged

Add sort and direction for fetching organizations repos #863

merged 4 commits into from
Apr 20, 2020

Conversation

pgrimaud
Copy link
Contributor

@pgrimaud pgrimaud commented Apr 20, 2020

Hi,

It's possible to sort repositories of organizations here : https://developer.github.com/v3/repos/#list-organization-repositories.

I added $sort and $direction parameters after actual parameters to avoid BC.

Associated tests are updated too.

*
* @return array the repositories
*/
public function repositories($organization, $type = 'all', $page = 1)
public function repositories($organization, $type = 'all', $page = 1, $sort = 'created', $direction = 'desc')
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 change this so the default value is null. Then check if the parameter is different from null and then add it to a $parameters array and pass it to the request.

This way we always use the default value of github and it won't cause BC breaks when github decided to change this default value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, I updated my PR. 😄

@acrobat acrobat merged commit 5eb55ce into KnpLabs:master Apr 20, 2020
@acrobat
Copy link
Collaborator

acrobat commented Apr 20, 2020

Thank you @pgrimaud

@pgrimaud
Copy link
Contributor Author

pgrimaud commented Apr 20, 2020

No problem!

This library is great! Thank you too!

I got a micro income on GitHub sponsors. If you had a lower tier on GitHub sponsors ($1), I would like to sponsor you to share my income because you deserve it 🙏.

@GrahamCampbell
Copy link
Contributor

The problem with such a small rate is the costs to accept it are pretty much the same as the payment value.

@acrobat
Copy link
Collaborator

acrobat commented Apr 20, 2020

No problem!

This library is great! Thank you too!

I got a micro income on GitHub sponsors. If you had a lower tier on GitHub sponsors ($1), I would like to sponsor you to share my income because you deserve it 🙏.

Thanks for the kind words and the feedback! I've added a 2 dollar tier, because every little bit helps! 🎉

@pgrimaud
Copy link
Contributor Author

@GrahamCampbell Which fees?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants