From d4ff97a7839d9e98d7ec2c28b52b7c552af20697 Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Fri, 13 Nov 2015 19:17:28 -0800 Subject: [PATCH 1/2] Added parameters to listIssues API --- client/services/GitHubIssues.php | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/client/services/GitHubIssues.php b/client/services/GitHubIssues.php index cb6c0b7..87652ad 100644 --- a/client/services/GitHubIssues.php +++ b/client/services/GitHubIssues.php @@ -99,11 +99,39 @@ public function listAllIssues($owner = false, $filter = null, $state = null, $la /** * List issues * + * @param $milestone number (Optional) - Milestone to associate this issue with. + * @param state string Indicates the state of the issues to return. Can be either open, closed, or all. Default: open + * @param $assignee string (Optional) - Login for the user that this issue should be assigned to. + * @param $creator string (Optional) - Login for the user that created this issue. + * @param $mentioned string (Optional) - Login for a user mentioned in this issue. + * @param labels string A list of comma separated label names. Example: bug,ui,@high + * @param sort string What to sort results by. Can be either created, updated, comments. Default: created + * @param direction string The direction of the sort. Can be either asc or desc. Default: desc + * @param since string Only issues updated at or after this time are returned. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. + * * @return array */ - public function listIssues($owner, $repo) + public function listIssues($owner, $repo, $milestone = null, $state = null, $assignee = null, $creator = null, $mentioned = null, $labels = null, $sort = null, $direction = null, $since) { $data = array(); + if(!is_null($milestone)) + $data['milestone'] = $milestone; + if(!is_null($state)) + $data['state'] = $state; + if(!is_null($assignee)) + $data['assignee'] = $assignee; + if(!is_null($creator)) + $data['creator'] = $creator; + if(!is_null($mentioned)) + $data['mentioned'] = $mentioned; + if(!is_null($labels)) + $data['labels'] = $labels; + if(!is_null($sort)) + $data['sort'] = $sort; + if(!is_null($direction)) + $data['direction'] = $direction; + if(!is_null($since)) + $data['since'] = $since; return $this->client->request("/repos/$owner/$repo/issues", 'GET', $data, 200, 'GitHubIssue', true); } From 2b6e8233ca7176f8c6bd57f25a026a0dd50debbc Mon Sep 17 00:00:00 2001 From: jdarwood007 Date: Fri, 13 Nov 2015 19:24:40 -0800 Subject: [PATCH 2/2] Missed a Null --- client/services/GitHubIssues.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/services/GitHubIssues.php b/client/services/GitHubIssues.php index 87652ad..e555d4a 100644 --- a/client/services/GitHubIssues.php +++ b/client/services/GitHubIssues.php @@ -111,7 +111,7 @@ public function listAllIssues($owner = false, $filter = null, $state = null, $la * * @return array */ - public function listIssues($owner, $repo, $milestone = null, $state = null, $assignee = null, $creator = null, $mentioned = null, $labels = null, $sort = null, $direction = null, $since) + public function listIssues($owner, $repo, $milestone = null, $state = null, $assignee = null, $creator = null, $mentioned = null, $labels = null, $sort = null, $direction = null, $since = null) { $data = array(); if(!is_null($milestone))