| Total Complexity | 7 |
| Total Lines | 59 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | class WordPress extends \SocialConnect\OAuth2\AbstractProvider |
||
| 15 | { |
||
| 16 | const NAME = 'wordpress'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * {@inheritdoc} |
||
| 20 | */ |
||
| 21 | 4 | public function getBaseUri() |
|
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * {@inheritdoc} |
||
| 28 | */ |
||
| 29 | 2 | public function getAuthorizeUri() |
|
| 30 | { |
||
| 31 | 2 | return 'https://public-api.wordpress.com/oauth2/authorize'; |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * {@inheritdoc} |
||
| 36 | */ |
||
| 37 | 2 | public function getRequestTokenUri() |
|
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * {@inheritdoc} |
||
| 44 | */ |
||
| 45 | 3 | public function getName() |
|
| 46 | { |
||
| 47 | 3 | return self::NAME; |
|
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * {@inheritDoc} |
||
| 52 | */ |
||
| 53 | 3 | public function prepareRequest(string $method, string $uri, array &$headers, array &$query, AccessTokenInterface $accessToken = null): void |
|
| 54 | { |
||
| 55 | 3 | if ($accessToken) { |
|
| 56 | 3 | $headers['Authorization'] = "Bearer {$accessToken->getToken()}"; |
|
| 57 | } |
||
| 58 | 3 | } |
|
| 59 | |||
| 60 | /** |
||
| 61 | * {@inheritdoc} |
||
| 62 | */ |
||
| 63 | 3 | public function getIdentity(AccessTokenInterface $accessToken) |
|
| 73 | } |
||
| 74 | } |
||
| 75 |