@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | protected array $authHeaders = ['Accept' => 'application/vnd.twitchtv.v5+json']; |
116 | 116 | protected array $apiHeaders = ['Accept' => 'application/vnd.twitchtv.v5+json']; |
117 | 117 | |
118 | - protected array $defaultScopes = [ |
|
118 | + protected array $defaultScopes = [ |
|
119 | 119 | self::SCOPE_USER_READ_EMAIL, |
120 | 120 | ]; |
121 | 121 | |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | 'grant_type' => 'client_credentials', |
134 | 134 | ]; |
135 | 135 | |
136 | - if($scopes !== null){ |
|
136 | + if ($scopes !== null) { |
|
137 | 137 | $params['scope'] = implode($this->scopesDelimiter, $scopes); |
138 | 138 | } |
139 | 139 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | ->withBody($this->streamFactory->createStream(http_build_query($params, '', '&', PHP_QUERY_RFC1738))) |
144 | 144 | ; |
145 | 145 | |
146 | - foreach($this->authHeaders as $header => $value){ |
|
146 | + foreach ($this->authHeaders as $header => $value) { |
|
147 | 147 | $request = $request->withAddedHeader($header, $value); |
148 | 148 | } |
149 | 149 |
@@ -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 |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | public function setInstance(string $instance):Mastodon{ |
120 | 120 | $instance = parse_url($instance); |
121 | 121 | |
122 | - if(!isset($instance['scheme']) || !isset($instance['host'])){ |
|
122 | + if (!isset($instance['scheme']) || !isset($instance['host'])) { |
|
123 | 123 | throw new OAuthException('invalid instance URL'); |
124 | 124 | } |
125 | 125 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | ->withHeader('Accept-Encoding', 'identity') |
156 | 156 | ->withBody($this->streamFactory->createStream(http_build_query($body, '', '&', PHP_QUERY_RFC1738))); |
157 | 157 | |
158 | - foreach($this->authHeaders as $header => $value){ |
|
158 | + foreach ($this->authHeaders as $header => $value) { |
|
159 | 159 | $request = $request->withHeader($header, $value); |
160 | 160 | } |
161 | 161 |
@@ -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 |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | /** |
27 | 27 | * @method \Psr\Http\Message\ResponseInterface me() |
28 | 28 | */ |
29 | -class Deezer extends OAuth2Provider implements CSRFToken{ |
|
29 | +class Deezer extends OAuth2Provider implements CSRFToken { |
|
30 | 30 | |
31 | 31 | public const SCOPE_BASIC = 'basic_access'; |
32 | 32 | public const SCOPE_EMAIL = 'email'; |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | public function getAuthURL(array $params = null, array $scopes = null):UriInterface{ |
60 | 60 | $params = $params ?? []; |
61 | 61 | |
62 | - if(isset($params['client_secret'])){ |
|
62 | + if (isset($params['client_secret'])) { |
|
63 | 63 | unset($params['client_secret']); |
64 | 64 | } |
65 | 65 | |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | protected function parseTokenResponse(ResponseInterface $response):AccessToken{ |
108 | 108 | parse_str(decompress_content($response), $data); |
109 | 109 | |
110 | - if(isset($data['error_reason'])){ |
|
110 | + if (isset($data['error_reason'])) { |
|
111 | 111 | throw new ProviderException('error retrieving access token: "'.$data['error_reason'].'"'); |
112 | 112 | } |
113 | 113 | |
114 | - if(!isset($data['access_token'])){ |
|
114 | + if (!isset($data['access_token'])) { |
|
115 | 115 | throw new ProviderException('token missing'); |
116 | 116 | } |
117 | 117 |