-
-
Notifications
You must be signed in to change notification settings - Fork 598
Add basic search api implementation. #186
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
*/ | ||
public function find($type = 'issues', $q = '', $sort = 'updated', $order = 'desc') | ||
{ | ||
if (!in_array($type, array('issues', 'repositories', 'code', 'users'))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of this, it would be much more consistent to have 4 methods on the class
I split into 4 methods and made the $client->api('search')->issues("repo:$repo $filter"); |
But |
Added to Client.php - I thought you were directing an edit to the class I added (i.e., Search.php). |
*/ | ||
public function repositories($q, $sort = 'updated', $order = 'desc') | ||
{ | ||
return $this->get("/search/repositories", array('q' => $q, 'sort' => $sort, 'order' => $order)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use single quotes (same in other methods)
@Nek- I would like seeing this feature merged (and released). It would be very helpful |
@wittiws could you add the test or you want somebody else to do it ? |
@Nek- I'm willing, but I'm not sure when I will be able to get to adding the tests. |
@Nek + @stof + @wittiws + @guillermoandrae Hi guys! |
@wittiws https://github.com/wittiws/php-github-api/pull/1 Thanks. UPD: also added documentation (search.md). |
Guys, please stop mentioning me in this thread. I'm Nek, the guy you want to refer is Nek-. Mind the dash. Thanks! |
Unit tests added for Github\Api\Search
@Nek- Implementation + tests + docs => Done. Can you please merge this pull request now and release new minor version? |
@stof Hi Christophe! Can you please help to make it done by merging? |
Add basic search api implementation.
@pilot Thank you very much! |
Example usage:
The new search api seems to need its own class since it returns objects in a different format. This basic function seems to mimic your API syntax pretty closely.