Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JGithubIssues
+ Graphe d'héritage de JGithubIssues:
+ Graphe de collaboration de JGithubIssues:

Liste de tous les membres

Fonctions membres publiques

 create ($user, $repo, $title, $body=null, $assignee=null, $milestone=null, array $labels=null)
 createComment ($user, $repo, $issueId, $body)
 createLabel ($user, $repo, $name, $color)
 deleteComment ($user, $repo, $commentId)
 deleteLabel ($user, $repo, $label)
 edit ($user, $repo, $issueId, $state=null, $title=null, $body=null, $assignee=null, $milestone=null, array $labels=null)
 editComment ($user, $repo, $commentId, $body)
 editLabel ($user, $repo, $label, $name, $color)
 get ($user, $repo, $issueId)
 getComment ($user, $repo, $commentId)
 getComments ($user, $repo, $issueId, $page=0, $limit=0)
 getLabel ($user, $repo, $name)
 getLabels ($user, $repo)
 getList ($filter=null, $state=null, $labels=null, $sort=null, $direction=null, JDate $since=null, $page=0, $limit=0)
 getListByRepository ($user, $repo, $milestone=null, $state=null, $assignee=null, $mentioned=null, $labels=null, $sort=null, $direction=null, JDate $since=null, $page=0, $limit=0)
- Fonctions membres publiques inherited from JGithubObject
 __construct (JRegistry $options=null, JGithubHttp $client=null)

Additional Inherited Members

- Fonctions membres protégées inherited from JGithubObject
 fetchUrl ($path, $page=0, $limit=0)
 processResponse (JHttpResponse $response, $expectedCode=200)
- Attributs protégés inherited from JGithubObject
 $options
 $client

Description détaillée

Définition à la ligne 19 du fichier issues.php.


Documentation des fonctions membres

JGithubIssues::create (   $user,
  $repo,
  $title,
  $body = null,
  $assignee = null,
  $milestone = null,
array  $labels = null 
)

Method to create an issue.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$titleThe title of the new issue.
string$bodyThe body text for the new issue.
string$assigneeThe login for the GitHub user that this issue should be assigned to.
integer$milestoneThe milestone to associate this issue with.
array$labelsThe labels to associate with this issue.
Renvoie:
object
Depuis:
11.3

Définition à la ligne 36 du fichier issues.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/issues';
// Ensure that we have a non-associative array.
if (isset($labels))
{
$labels = array_values($labels);
}
// Build the request data.
$data = json_encode(
array(
'title' => $title,
'assignee' => $assignee,
'milestone' => $milestone,
'labels' => $labels,
'body' => $body
)
);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
// Validate the response code.
if ($response->code != 201)
{
// 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);
}
JGithubIssues::createComment (   $user,
  $repo,
  $issueId,
  $body 
)

Method to create a comment on an issue.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$issueIdThe issue number.
string$bodyThe comment body text.
Renvoie:
object
Depuis:
11.3

Définition à la ligne 84 du fichier issues.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/issues/' . (int) $issueId . '/comments';
// Build the request data.
$data = json_encode(
array(
'body' => $body,
)
);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
// Validate the response code.
if ($response->code != 201)
{
// 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);
}
JGithubIssues::createLabel (   $user,
  $repo,
  $name,
  $color 
)

Method to create a label on a repo.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$nameThe label name.
string$colorThe label color.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 122 du fichier issues.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/labels';
// Build the request data.
$data = json_encode(
array(
'name' => $name,
'color' => $color
)
);
// Send the request.
$response = $this->client->post($this->fetchUrl($path), $data);
// Validate the response code.
if ($response->code != 201)
{
// 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);
}
JGithubIssues::deleteComment (   $user,
  $repo,
  $commentId 
)

Method to delete a comment on an issue.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$commentIdThe id of the comment to delete.
Renvoie:
void
Depuis:
11.3

Définition à la ligne 160 du fichier issues.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/issues/comments/' . (int) $commentId;
// Send the request.
$response = $this->client->delete($this->fetchUrl($path));
// Validate the response code.
if ($response->code != 204)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
}
JGithubIssues::deleteLabel (   $user,
  $repo,
  $label 
)

Method to delete a label on a repo.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$labelThe label name.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 188 du fichier issues.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/labels/' . $label;
// Send the request.
$response = $this->client->delete($this->fetchUrl($path));
// Validate the response code.
if ($response->code != 204)
{
// Decode the error response and throw an exception.
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
}
JGithubIssues::edit (   $user,
  $repo,
  $issueId,
  $state = null,
  $title = null,
  $body = null,
  $assignee = null,
  $milestone = null,
array  $labels = null 
)

Method to update an issue.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$issueIdThe issue number.
string$stateThe optional new state for the issue. [open, closed]
string$titleThe title of the new issue.
string$bodyThe body text for the new issue.
string$assigneeThe login for the GitHub user that this issue should be assigned to.
integer$milestoneThe milestone to associate this issue with.
array$labelsThe labels to associate with this issue.
Renvoie:
object
Depuis:
11.3

Définition à la ligne 222 du fichier issues.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/issues/' . (int) $issueId;
// Craete the data object.
$data = new stdClass;
// If a title is set add it to the data object.
if (isset($title))
{
$data->title = $title;
}
// If a body is set add it to the data object.
if (isset($body))
{
$data->body = $body;
}
// If a state is set add it to the data object.
if (isset($state))
{
$data->state = $state;
}
// If an assignee is set add it to the data object.
if (isset($assignee))
{
$data->assignee = $assignee;
}
// If a milestone is set add it to the data object.
if (isset($milestone))
{
$data->milestone = $milestone;
}
// If labels are set add them to the data object.
if (isset($labels))
{
// Ensure that we have a non-associative array.
if (isset($labels))
{
$labels = array_values($labels);
}
$data->labels = $labels;
}
// Encode the request data.
$data = json_encode($data);
// Send the request.
$response = $this->client->patch($this->fetchUrl($path), $data);
// 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);
}
JGithubIssues::editComment (   $user,
  $repo,
  $commentId,
  $body 
)

Method to update a comment on an issue.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$commentIdThe id of the comment to update.
string$bodyThe new body text for the comment.
Renvoie:
object
Depuis:
11.3

Définition à la ligne 301 du fichier issues.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/issues/comments/' . (int) $commentId;
// Build the request data.
$data = json_encode(
array(
'body' => $body
)
);
// Send the request.
$response = $this->client->patch($this->fetchUrl($path), $data);
// 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);
}
JGithubIssues::editLabel (   $user,
  $repo,
  $label,
  $name,
  $color 
)

Method to update a label on a repo.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$labelThe label name.
string$nameThe label name.
string$colorThe label color.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 340 du fichier issues.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/labels/' . $label;
// Build the request data.
$data = json_encode(
array(
'name' => $name,
'color' => $color
)
);
// Send the request.
$response = $this->client->patch($this->fetchUrl($path), $data);
// 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);
}
JGithubIssues::get (   $user,
  $repo,
  $issueId 
)

Method to get a single issue.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$issueIdThe issue number.
Renvoie:
object
Depuis:
11.3

Définition à la ligne 378 du fichier issues.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/issues/' . (int) $issueId;
// 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);
}
JGithubIssues::getComment (   $user,
  $repo,
  $commentId 
)

Method to get a specific comment on an issue.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$commentIdThe comment id to get.
Renvoie:
object
Depuis:
11.3

Définition à la ligne 408 du fichier issues.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/issues/comments/' . (int) $commentId;
// 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);
}
JGithubIssues::getComments (   $user,
  $repo,
  $issueId,
  $page = 0,
  $limit = 0 
)

Method to get the list of comments on an issue.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
integer$issueIdThe issue number.
integer$pageThe page number from which to get items.
integer$limitThe number of items on a page.
Renvoie:
array
Depuis:
11.3

Définition à la ligne 440 du fichier issues.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/issues/' . (int) $issueId . '/comments';
// Send the request.
$response = $this->client->get($this->fetchUrl($path, $page, $limit));
// 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);
}
JGithubIssues::getLabel (   $user,
  $repo,
  $name 
)

Method to get a specific label on a repo.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$nameThe label name to get.
Renvoie:
object
Depuis:
12.3

Définition à la ligne 470 du fichier issues.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/labels/' . $name;
// 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);
}
JGithubIssues::getLabels (   $user,
  $repo 
)

Method to get the list of labels on a repo.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
Renvoie:
array
Depuis:
12.3

Définition à la ligne 499 du fichier issues.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/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);
}
JGithubIssues::getList (   $filter = null,
  $state = null,
  $labels = null,
  $sort = null,
  $direction = null,
JDate  $since = null,
  $page = 0,
  $limit = 0 
)

Method to list an authenticated user's issues.

Paramètres:
string$filterThe filter type: assigned, created, mentioned, subscribed.
string$stateThe optional state to filter requests by. [open, closed]
string$labelsThe list of comma separated Label names. Example: bug,ui,.
string$sortThe sort order: created, updated, comments, default: created.
string$directionThe list direction: asc or desc, default: desc.
JDate$sinceThe date/time since when issues should be returned.
integer$pageThe page number from which to get items.
integer$limitThe number of items on a page.
Renvoie:
array
Depuis:
11.3

Définition à la ligne 534 du fichier issues.php.

{
// Build the request path.
$path = '/issues';
// TODO Implement the filtering options.
// Send the request.
$response = $this->client->get($this->fetchUrl($path, $page, $limit));
// 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);
}
JGithubIssues::getListByRepository (   $user,
  $repo,
  $milestone = null,
  $state = null,
  $assignee = null,
  $mentioned = null,
  $labels = null,
  $sort = null,
  $direction = null,
JDate  $since = null,
  $page = 0,
  $limit = 0 
)

Method to list issues.

Paramètres:
string$userThe name of the owner of the GitHub repository.
string$repoThe name of the GitHub repository.
string$milestoneThe milestone number, 'none', or *.
string$stateThe optional state to filter requests by. [open, closed]
string$assigneeThe assignee name, 'none', or *.
string$mentionedThe GitHub user name.
string$labelsThe list of comma separated Label names. Example: bug,ui,.
string$sortThe sort order: created, updated, comments, default: created.
string$directionThe list direction: asc or desc, default: desc.
JDate$sinceThe date/time since when issues should be returned.
integer$pageThe page number from which to get items.
integer$limitThe number of items on a page.
Renvoie:
array
Depuis:
11.3

Définition à la ligne 575 du fichier issues.php.

{
// Build the request path.
$path = '/repos/' . $user . '/' . $repo . '/issues';
$uri = new JUri($this->fetchUrl($path, $page, $limit));
if ($milestone)
{
$uri->setVar('milestone', $milestone);
}
if ($state)
{
$uri->setVar('state', $state);
}
if ($assignee)
{
$uri->setVar('assignee', $assignee);
}
if ($mentioned)
{
$uri->setVar('mentioned', $mentioned);
}
if ($labels)
{
$uri->setVar('labels', $labels);
}
if ($sort)
{
$uri->setVar('sort', $sort);
}
if ($direction)
{
$uri->setVar('direction', $direction);
}
if ($since)
{
$uri->setVar('since', $since->toISO8601());
}
// Send the request.
$response = $this->client->get((string) $uri);
// 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);
}

La documentation de cette classe a été générée à partir du fichier suivant :