@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | /** |
29 | 29 | * @method \Psr\Http\Message\ResponseInterface me() |
30 | 30 | */ |
31 | -class Deezer extends OAuth2Provider implements CSRFToken{ |
|
31 | +class Deezer extends OAuth2Provider implements CSRFToken { |
|
32 | 32 | |
33 | 33 | public const SCOPE_BASIC = 'basic_access'; |
34 | 34 | public const SCOPE_EMAIL = 'email'; |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | public function getAuthURL(array $params = null, array $scopes = null):UriInterface{ |
54 | 54 | $params = $params ?? []; |
55 | 55 | |
56 | - if(isset($params['client_secret'])){ |
|
56 | + if (isset($params['client_secret'])) { |
|
57 | 57 | unset($params['client_secret']); |
58 | 58 | } |
59 | 59 | |
@@ -101,15 +101,15 @@ discard block |
||
101 | 101 | protected function parseTokenResponse(ResponseInterface $response):AccessToken{ |
102 | 102 | parse_str(decompress_content($response), $data); |
103 | 103 | |
104 | - if(!is_array($data) || empty($data)){ |
|
104 | + if (!is_array($data) || empty($data)) { |
|
105 | 105 | throw new ProviderException('unable to parse token response'); |
106 | 106 | } |
107 | 107 | |
108 | - if(isset($data['error_reason'])){ |
|
108 | + if (isset($data['error_reason'])) { |
|
109 | 109 | throw new ProviderException('error retrieving access token: "'.$data['error_reason'].'"'); |
110 | 110 | } |
111 | 111 | |
112 | - if(!isset($data['access_token'])){ |
|
112 | + if (!isset($data['access_token'])) { |
|
113 | 113 | throw new ProviderException('token missing'); |
114 | 114 | } |
115 | 115 |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | protected $authHeaders = ['Accept' => 'application/vnd.twitchtv.v5+json']; |
57 | 57 | protected $apiHeaders = ['Accept' => 'application/vnd.twitchtv.v5+json']; |
58 | - protected $authMethod = self::HEADER_OAUTH; // -> https://api.twitch.tv/kraken |
|
58 | + protected $authMethod = self::HEADER_OAUTH; // -> https://api.twitch.tv/kraken |
|
59 | 59 | # protected $authMethod = self::HEADER_BEARER; // -> https://api.twitch.tv/helix |
60 | 60 | protected $endpointMap = TwitchEndpoints::class; |
61 | 61 | protected $apiDocs = 'https://dev.twitch.tv/docs/api/reference/'; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | 'grant_type' => 'client_credentials', |
76 | 76 | ]; |
77 | 77 | |
78 | - if($scopes !== null){ |
|
78 | + if ($scopes !== null) { |
|
79 | 79 | $params['scope'] = implode($this->scopesDelimiter, $scopes); |
80 | 80 | } |
81 | 81 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | ->withBody($this->streamFactory->createStream(http_build_query($params, '', '&', PHP_QUERY_RFC1738))) |
86 | 86 | ; |
87 | 87 | |
88 | - foreach($this->authHeaders as $header => $value){ |
|
88 | + foreach ($this->authHeaders as $header => $value) { |
|
89 | 89 | $request = $request->withAddedHeader($header, $value); |
90 | 90 | } |
91 | 91 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | /** |
21 | 21 | * @method \Psr\Http\Message\ResponseInterface me() |
22 | 22 | */ |
23 | -class Gitter extends OAuth2Provider implements CSRFToken{ |
|
23 | +class Gitter extends OAuth2Provider implements CSRFToken { |
|
24 | 24 | |
25 | 25 | public const SCOPE_FLOW = 'flow'; |
26 | 26 | public const SCOPE_PRIVATE = 'private'; |
@@ -21,7 +21,7 @@ |
||
21 | 21 | * @method \Psr\Http\Message\ResponseInterface me() |
22 | 22 | * @method \Psr\Http\Message\ResponseInterface user(string $id) |
23 | 23 | */ |
24 | -class SoundCloud extends OAuth2Provider{ |
|
24 | +class SoundCloud extends OAuth2Provider { |
|
25 | 25 | |
26 | 26 | public const SCOPE_NONEXPIRING = 'non-expiring'; |
27 | 27 | # public const SCOPE_EMAIL = 'email'; // ??? |