Total Complexity | 8 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class Discord extends \SocialConnect\OAuth2\AbstractProvider |
||
15 | { |
||
16 | const NAME = 'discord'; |
||
17 | |||
18 | /** |
||
19 | * {@inheritdoc} |
||
20 | */ |
||
21 | 4 | public function getBaseUri() |
|
22 | { |
||
23 | 4 | return 'https://discordapp.com/api/'; |
|
24 | } |
||
25 | |||
26 | /** |
||
27 | * {@inheritdoc} |
||
28 | */ |
||
29 | 2 | public function getAuthorizeUri() |
|
32 | } |
||
33 | |||
34 | /** |
||
35 | * {@inheritdoc} |
||
36 | */ |
||
37 | 2 | public function getRequestTokenUri() |
|
38 | { |
||
39 | 2 | return 'https://discordapp.com/api/oauth2/token'; |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * {@inheritdoc} |
||
44 | */ |
||
45 | 3 | public function getName() |
|
48 | } |
||
49 | |||
50 | /** |
||
51 | * @return string |
||
52 | */ |
||
53 | 1 | public function getScopeInline() |
|
56 | } |
||
57 | |||
58 | /** |
||
59 | * {@inheritDoc} |
||
60 | */ |
||
61 | 3 | public function prepareRequest(string $method, string $uri, array &$headers, array &$query, AccessTokenInterface $accessToken = null): void |
|
62 | { |
||
63 | 3 | if ($accessToken) { |
|
64 | 3 | $headers['Authorization'] = "Bearer {$accessToken->getToken()}"; |
|
65 | } |
||
66 | 3 | } |
|
67 | |||
68 | /** |
||
69 | * {@inheritdoc} |
||
70 | */ |
||
71 | 3 | public function getIdentity(AccessTokenInterface $accessToken) |
|
80 | } |
||
81 | } |
||
82 |