@@ -16,7 +16,7 @@ |
||
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | */ |
| 19 | -class ImgurEndpoints extends EndpointMap{ |
|
| 19 | +class ImgurEndpoints extends EndpointMap { |
|
| 20 | 20 | |
| 21 | 21 | protected array $me = [ |
| 22 | 22 | 'path' => '/3/account/me', |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | * @link https://discordapp.com/developers/docs/intro |
| 19 | 19 | * @todo |
| 20 | 20 | */ |
| 21 | -class DiscordEndpoints extends EndpointMap{ |
|
| 21 | +class DiscordEndpoints extends EndpointMap { |
|
| 22 | 22 | |
| 23 | 23 | protected array $me = [ |
| 24 | 24 | 'path' => '/users/@me', |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * @link https://dev.npr.org/api/ |
| 19 | 19 | */ |
| 20 | -class NPROneEndpoints extends EndpointMap{ |
|
| 20 | +class NPROneEndpoints extends EndpointMap { |
|
| 21 | 21 | |
| 22 | 22 | protected string $API_BASE = 'https://'; // i hate this so much |
| 23 | 23 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | /** |
| 16 | 16 | * @method \Psr\Http\Message\ResponseInterface me(array $params = ['schema']) |
| 17 | 17 | */ |
| 18 | -class PayPalSandbox extends PayPal{ |
|
| 18 | +class PayPalSandbox extends PayPal { |
|
| 19 | 19 | |
| 20 | 20 | protected string $authURL = 'https://www.sandbox.paypal.com/connect'; |
| 21 | 21 | protected string $accessTokenURL = 'https://api.sandbox.paypal.com/v1/oauth2/token'; |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * @link https://developer.paypal.com/docs/api/identity/v1/ |
| 19 | 19 | */ |
| 20 | -class PayPalEndpoints extends EndpointMap{ |
|
| 20 | +class PayPalEndpoints extends EndpointMap { |
|
| 21 | 21 | |
| 22 | 22 | protected array $me = [ |
| 23 | 23 | 'path' => '/v1/identity/oauth2/userinfo', |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * @link https://docs.gitlab.com/ee/api/README.html |
| 19 | 19 | */ |
| 20 | -class GitLabV4Endpoints extends EndpointMap{ |
|
| 20 | +class GitLabV4Endpoints extends EndpointMap { |
|
| 21 | 21 | |
| 22 | 22 | protected string $API_BASE = '/v4'; |
| 23 | 23 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * @method \Psr\Http\Message\ResponseInterface ping() |
| 30 | 30 | * @method \Psr\Http\Message\ResponseInterface root(array $params = ['fields', 'exclude_fields']) |
| 31 | 31 | */ |
| 32 | -class MailChimp extends OAuth2Provider implements CSRFToken{ |
|
| 32 | +class MailChimp extends OAuth2Provider implements CSRFToken { |
|
| 33 | 33 | |
| 34 | 34 | protected const API_BASE = 'https://%s.api.mailchimp.com/3.0'; |
| 35 | 35 | protected const METADATA_ENDPOINT = 'https://login.mailchimp.com/oauth2/metadata'; |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | |
| 52 | 52 | $token ??= $this->storage->getAccessToken($this->serviceName); |
| 53 | 53 | |
| 54 | - if(!$token instanceof AccessToken){ |
|
| 54 | + if (!$token instanceof AccessToken) { |
|
| 55 | 55 | throw new OAuthException('invalid token'); // @codeCoverageIgnore |
| 56 | 56 | } |
| 57 | 57 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | $response = $this->http->sendRequest($request); |
| 64 | 64 | |
| 65 | - if($response->getStatusCode() !== 200){ |
|
| 65 | + if ($response->getStatusCode() !== 200) { |
|
| 66 | 66 | throw new OAuthException('metadata response error'); // @codeCoverageIgnore |
| 67 | 67 | } |
| 68 | 68 | |
@@ -47,21 +47,21 @@ discard block |
||
| 47 | 47 | protected function parseTokenResponse(ResponseInterface $response):AccessToken{ |
| 48 | 48 | $data = json_decode(decompress_content($response), true); |
| 49 | 49 | |
| 50 | - if(!is_array($data)){ |
|
| 50 | + if (!is_array($data)) { |
|
| 51 | 51 | throw new ProviderException('unable to parse token response'); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - foreach(['error_description', 'error'] as $field){ |
|
| 55 | - if(isset($data[$field])){ |
|
| 54 | + foreach (['error_description', 'error'] as $field) { |
|
| 55 | + if (isset($data[$field])) { |
|
| 56 | 56 | throw new ProviderException('error retrieving access token: "'.$data[$field].'"'); |
| 57 | 57 | } |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | // @codeCoverageIgnoreStart |
| 61 | - if(isset($data['name'], $data['message'])){ |
|
| 61 | + if (isset($data['name'], $data['message'])) { |
|
| 62 | 62 | $msg = sprintf('error retrieving access token: "%s" [%s]', $data['message'], $data['name']); |
| 63 | 63 | |
| 64 | - if(isset($data['links']) && is_array($data['links'])){ |
|
| 64 | + if (isset($data['links']) && is_array($data['links'])) { |
|
| 65 | 65 | $msg .= "\n".implode("\n", array_column($data['links'], 'href')); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | // @codeCoverageIgnoreEnd |
| 71 | 71 | |
| 72 | - if(!isset($data['access_token'])){ |
|
| 72 | + if (!isset($data['access_token'])) { |
|
| 73 | 73 | throw new ProviderException('token missing'); |
| 74 | 74 | } |
| 75 | 75 | |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | use chillerlan\OAuth\MagicAPI\EndpointMap; |
| 14 | 14 | |
| 15 | -class SteamEndpoints extends EndpointMap{ |
|
| 15 | +class SteamEndpoints extends EndpointMap { |
|
| 16 | 16 | |
| 17 | 17 | /* |
| 18 | 18 | * ISteamApps |