Total Complexity | 4 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
24 | final class TwitterOAuth2 extends OAuth2 |
||
25 | { |
||
26 | protected string $authUrl = 'https://api.twitter.com/oauth2/authenticate'; |
||
27 | protected string $tokenUrl = 'https://api.twitter.com/oauth2/token'; |
||
28 | protected string $endpoint = 'https://api.twitter.com/1.1'; |
||
29 | |||
30 | public function applyAccessTokenToRequest(RequestInterface $request, OAuthToken $accessToken): RequestInterface |
||
31 | { |
||
32 | return $request->withHeader('Authorization', 'Bearer ' . $accessToken->getToken()); |
||
33 | } |
||
34 | |||
35 | /** |
||
36 | * @return string service name. |
||
37 | */ |
||
38 | public function getName(): string |
||
39 | { |
||
40 | return 'twitter'; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @return string service title. |
||
45 | */ |
||
46 | public function getTitle(): string |
||
47 | { |
||
48 | return 'Twitter'; |
||
49 | } |
||
50 | |||
51 | protected function initUserAttributes(): array |
||
54 | } |
||
55 | } |
||
56 |