@@ -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 |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | use chillerlan\OAuth\MagicAPI\EndpointMap; |
| 13 | 13 | |
| 14 | -class TwitchEndpoints extends EndpointMap{ |
|
| 14 | +class TwitchEndpoints extends EndpointMap { |
|
| 15 | 15 | |
| 16 | 16 | protected string $API_BASE = '/helix'; |
| 17 | 17 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | use chillerlan\OAuth\MagicAPI\EndpointMap; |
| 13 | 13 | |
| 14 | -class SpotifyEndpoints extends EndpointMap{ |
|
| 14 | +class SpotifyEndpoints extends EndpointMap { |
|
| 15 | 15 | |
| 16 | 16 | protected string $API_BASE = '/v1'; |
| 17 | 17 | |
@@ -124,7 +124,7 @@ |
||
| 124 | 124 | protected array $authHeaders = ['Accept' => 'application/vnd.vimeo.*+json;version='.self::API_VERSION]; |
| 125 | 125 | protected array $apiHeaders = ['Accept' => 'application/vnd.vimeo.*+json;version='.self::API_VERSION]; |
| 126 | 126 | |
| 127 | - protected array $defaultScopes = [ |
|
| 127 | + protected array $defaultScopes = [ |
|
| 128 | 128 | self::SCOPE_PRIVATE, |
| 129 | 129 | self::SCOPE_INTERACT, |
| 130 | 130 | ]; |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | use chillerlan\OAuth\MagicAPI\EndpointMap; |
| 13 | 13 | |
| 14 | -class OpenCachingEndpoints extends EndpointMap{ |
|
| 14 | +class OpenCachingEndpoints extends EndpointMap { |
|
| 15 | 15 | |
| 16 | 16 | protected string $API_BASE = '/services'; |
| 17 | 17 | |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | use chillerlan\OAuth\MagicAPI\EndpointMap; |
| 13 | 13 | |
| 14 | -class LastFMEndpoints extends EndpointMap{ |
|
| 14 | +class LastFMEndpoints extends EndpointMap { |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Tag an album using a list of user supplied tags. |
@@ -11,7 +11,7 @@ |
||
| 11 | 11 | |
| 12 | 12 | use chillerlan\OAuth\MagicAPI\EndpointMap; |
| 13 | 13 | |
| 14 | -class SoundCloudEndpoints extends EndpointMap{ |
|
| 14 | +class SoundCloudEndpoints extends EndpointMap { |
|
| 15 | 15 | |
| 16 | 16 | /** |
| 17 | 17 | * Returns the authenticated user’s information. |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | * @method \Psr\Http\Message\ResponseInterface usersUserIdTracks(string $user_id, array $params = ['limit', 'linked_partitioning']) |
| 75 | 75 | * @method \Psr\Http\Message\ResponseInterface usersUserIdWebProfiles(string $user_id, array $params = ['limit']) |
| 76 | 76 | */ |
| 77 | -class SoundCloud extends OAuth2Provider{ |
|
| 77 | +class SoundCloud extends OAuth2Provider { |
|
| 78 | 78 | |
| 79 | 79 | public const SCOPE_NONEXPIRING = 'non-expiring'; |
| 80 | 80 | # public const SCOPE_EMAIL = 'email'; // ??? |