Liste de tous les membres
Description détaillée
Définition à la ligne 19 du fichier account.php.
Documentation des fonctions membres
JGithubAccount::createAuthorisation |
( |
array |
$scopes = array() , |
|
|
|
$note = '' , |
|
|
|
$url = '' |
|
) |
| |
Method to create an authorisation.
- Paramètres:
-
array | $scopes | A list of scopes that this authorisation is in. |
string | $note | A note to remind you what the OAuth token is for. |
string | $url | A URL to remind you what app the OAuth token is for. |
- Renvoie:
- object
- Depuis:
- 12.3
- Exceptions:
-
Définition à la ligne 33 du fichier account.php.
{
$path = '/authorizations';
$data = json_encode(
array('scopes' => $scopes, 'note' => $note, 'note_url' => $url)
);
$response = $this->client->post($this->
fetchUrl($path), $data);
if ($response->code != 201)
{
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
JGithubAccount::deleteAuthorisation |
( |
|
$id | ) |
|
Method to delete an authorisation
- Paramètres:
-
integer | $id | ID of the authorisation to delete |
- Renvoie:
- object
- Depuis:
- 12.3
- Exceptions:
-
Définition à la ligne 66 du fichier account.php.
{
$path = '/authorizations/' . $id;
$response = $this->client->delete($this->
fetchUrl($path));
if ($response->code != 204)
{
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
JGithubAccount::editAuthorisation |
( |
|
$id, |
|
|
array |
$scopes = array() , |
|
|
array |
$addScopes = array() , |
|
|
array |
$removeScopes = array() , |
|
|
|
$note = '' , |
|
|
|
$url = '' |
|
) |
| |
Method to edit an authorisation.
- Paramètres:
-
integer | $id | ID of the authorisation to edit |
array | $scopes | Replaces the authorisation scopes with these. |
array | $addScopes | A list of scopes to add to this authorisation. |
array | $removeScopes | A list of scopes to remove from this authorisation. |
string | $note | A note to remind you what the OAuth token is for. |
string | $url | A URL to remind you what app the OAuth token is for. |
- Renvoie:
- object
- Depuis:
- 12.3
- Exceptions:
-
DomainException | |
RuntimeException | |
Définition à la ligne 101 du fichier account.php.
{
$scopesCount = 0;
if (!empty($scopes))
{
$scope = 'scopes';
$scopeData = $scopes;
$scopesCount++;
}
if (!empty($addScopes))
{
$scope = 'add_scopes';
$scopeData = $addScopes;
$scopesCount++;
}
if (!empty($removeScopes))
{
$scope = 'remove_scopes';
$scopeData = $removeScopes;
$scopesCount++;
}
if ($scopesCount >= 2)
{
throw new RuntimeException('You can only send one scope key in this request.');
}
$path = '/authorizations/' . $id;
$data = json_encode(
array(
$scope => $scopeData,
'note' => $note,
'note_url' => $url
)
);
$response = $this->client->patch($this->
fetchUrl($path), $data);
if ($response->code != 200)
{
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
JGithubAccount::getAuthorisation |
( |
|
$id | ) |
|
Method to get details about an authorised application for the authenticated user.
- Paramètres:
-
integer | $id | ID of the authorisation to retrieve |
- Renvoie:
- object
- Depuis:
- 12.3
- Note:
- This method will only accept Basic Authentication
- Exceptions:
-
Définition à la ligne 167 du fichier account.php.
{
$path = '/authorizations/' . $id;
$response = $this->client->get($this->
fetchUrl($path));
if ($response->code != 200)
{
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
JGithubAccount::getAuthorisations |
( |
| ) |
|
Method to get the authorised applications for the authenticated user.
- Renvoie:
- object
- Depuis:
- 12.3
- Exceptions:
-
- Note:
- This method will only accept Basic Authentication
Définition à la ligne 195 du fichier account.php.
{
$path = '/authorizations';
$response = $this->client->get($this->
fetchUrl($path));
if ($response->code != 200)
{
$error = json_decode($response->body);
throw new DomainException($error->message, $response->code);
}
return json_decode($response->body);
}
JGithubAccount::getRateLimit |
( |
| ) |
|
Method to get the rate limit for the authenticated user.
- Renvoie:
- object
- Depuis:
- 12.3
- Exceptions:
-
Définition à la ligne 222 du fichier account.php.
{
$path = '/rate_limit';
$response = $this->client->get($this->
fetchUrl($path));
if ($response->code != 200)
{
$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 :