Skip to content
This repository has been archived by the owner on Nov 26, 2017. It is now read-only.

Commit

Permalink
get a list of labels by issue
Browse files Browse the repository at this point in the history
  • Loading branch information
unknown authored and unknown committed Apr 6, 2012
1 parent da45452 commit 8da1f00
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions libraries/joomla/github/issues.php
Expand Up @@ -517,6 +517,36 @@ public function getLabels($user, $repo)
return json_decode($response->body);
}

/**
* Method to get the list of labels on an issue.
*
* @param string $user The name of the owner of the GitHub repository.
* @param string $repo The name of the GitHub repository.
* @param integer $issueId The issue number.
*
* @return array
*
* @since 12.1
*/
public function getLabelsByIssue($user, $repo, $issueId)
{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/issues/' . $issueId . '/labels';

// Send the request.
$response = $this->client->get($this->fetchUrl($path));

// Validate the response code.
if ($response->code != 200)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}

return json_decode($response->body);
}

/**
* Method to list an authenticated user's issues.
*
Expand Down

0 comments on commit 8da1f00

Please sign in to comment.