Repository navigation
Expand file tree
/
Copy pathAuthorizations.php
More file actions
65 lines (60 loc) · 1.6 KB
/
Copy pathAuthorizations.php
File metadata and controls
65 lines (60 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
namespace Github\Api;
/**
* Creating, deleting and listing authorizations.
*
* @link http://developer.github.com/v3/oauth_authorizations/
*
* @author Evgeniy Guseletov <d46k16@gmail.com>
*/
class Authorizations extends AbstractApi
{
/**
* Check an application token.
*
* @param string $clientId
* @param string|null $token
*
* @return array
*/
public function checkToken($clientId, $token = null)
{
return $this->post('/applications/'.rawurlencode($clientId).'/token', $token ? ['access_token' => $token] : []);
}
/**
* Reset an application token.
*
* @param string $clientId
* @param string|null $token
*
* @return array
*/
public function resetToken($clientId, $token = null)
{
return $this->patch('/applications/'.rawurlencode($clientId).'/token', $token ? ['access_token' => $token] : []);
}
/**
* Revoke an application token.
*
* @param string $clientId
* @param string|null $token
*
* @return void
*/
public function deleteToken($clientId, $token = null)
{
$this->delete('/applications/'.rawurlencode($clientId).'/token', $token ? ['access_token' => $token] : []);
}
/**
* Revoke an application authorization.
*
* @param string $clientId
* @param string|null $token
*
* @return void
*/
public function deleteGrant($clientId, $token = null)
{
$this->delete('/applications/'.rawurlencode($clientId).'/grant', $token ? ['access_token' => $token] : []);
}
}