Add sort and direction for fetching organizations repos - #863
Conversation
| * @return array the repositories | ||
| */ | ||
| public function repositories($organization, $type = 'all', $page = 1) | ||
| public function repositories($organization, $type = 'all', $page = 1, $sort = 'created', $direction = 'desc') |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Alright, I updated my PR. 😄
|
Thank you @pgrimaud |
|
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 🙏. |
|
The problem with such a small rate is the costs to accept it are pretty much the same as the payment value. |
Thanks for the kind words and the feedback! I've added a 2 dollar tier, because every little bit helps! 🎉 |
|
@GrahamCampbell Which fees? |
Hi,
It's possible to sort repositories of organizations here : https://developer.github.com/v3/repos/#list-organization-repositories.
I added
$sortand$directionparameters after actual parameters to avoid BC.Associated tests are updated too.