Skip to content

Add sort and direction for fetching organizations repos - #863

Merged
acrobat merged 4 commits into
KnpLabs:masterfrom
pgrimaud:master
Apr 20, 2020
Merged

Add sort and direction for fetching organizations repos#863
acrobat merged 4 commits into
KnpLabs:masterfrom
pgrimaud:master

Conversation

@pgrimaud

@pgrimaud pgrimaud commented Apr 20, 2020

Copy link
Copy Markdown
Contributor

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.

Comment thread lib/Github/Api/Organization.php Outdated
* @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
Copy Markdown
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
Copy Markdown
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

acrobat commented Apr 20, 2020

Copy link
Copy Markdown
Collaborator

Thank you @pgrimaud

@pgrimaud

pgrimaud commented Apr 20, 2020

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Contributor

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

@acrobat

acrobat commented Apr 20, 2020

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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.

3 participants