@@ -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 $me = [ |
| 24 | 24 | 'path' => '/users/@me', |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * @link https://developers.deezer.com/api/ |
| 19 | 19 | */ |
| 20 | -class DeezerEndpoints extends EndpointMap{ |
|
| 20 | +class DeezerEndpoints extends EndpointMap { |
|
| 21 | 21 | |
| 22 | 22 | protected $me = [ |
| 23 | 23 | 'path' => '/user/me', |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | public function getAuthURL(array $params = null, array $scopes = null):UriInterface{ |
| 50 | 50 | $params = $params ?? []; |
| 51 | 51 | |
| 52 | - if(isset($params['client_secret'])){ |
|
| 52 | + if (isset($params['client_secret'])) { |
|
| 53 | 53 | unset($params['client_secret']); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -97,15 +97,15 @@ discard block |
||
| 97 | 97 | protected function parseTokenResponse(ResponseInterface $response):AccessToken{ |
| 98 | 98 | \parse_str(Psr7\decompress_content($response), $data); |
| 99 | 99 | |
| 100 | - if(!\is_array($data) || empty($data)){ |
|
| 100 | + if (!\is_array($data) || empty($data)) { |
|
| 101 | 101 | throw new ProviderException('unable to parse token response'); |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - if(isset($data['error_reason'])){ |
|
| 104 | + if (isset($data['error_reason'])) { |
|
| 105 | 105 | throw new ProviderException('error retrieving access token: "'.$data['error_reason'].'"'); |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - if(!isset($data['access_token'])){ |
|
| 108 | + if (!isset($data['access_token'])) { |
|
| 109 | 109 | throw new ProviderException('token missing'); |
| 110 | 110 | } |
| 111 | 111 | |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * @link https://www.deviantart.com/developers/http/v1/20160316 |
| 19 | 19 | */ |
| 20 | -class DeviantArtEndpoints extends EndpointMap{ |
|
| 20 | +class DeviantArtEndpoints extends EndpointMap { |
|
| 21 | 21 | |
| 22 | 22 | protected $whoami = [ |
| 23 | 23 | 'path' => '/user/whoami', |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * @link https://dev.twitch.tv/docs/api/reference/ |
| 19 | 19 | */ |
| 20 | -class TwitchEndpoints extends EndpointMap{ |
|
| 20 | +class TwitchEndpoints extends EndpointMap { |
|
| 21 | 21 | |
| 22 | 22 | protected $me = [ |
| 23 | 23 | 'path' => '/user', |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | # protected $accessTokenExpires = true; |
| 52 | 52 | protected $authHeaders = ['Accept' => 'application/vnd.twitchtv.v5+json']; |
| 53 | 53 | protected $apiHeaders = ['Accept' => 'application/vnd.twitchtv.v5+json']; |
| 54 | - protected $authMethod = self::HEADER_OAUTH; // -> https://api.twitch.tv/kraken |
|
| 54 | + protected $authMethod = self::HEADER_OAUTH; // -> https://api.twitch.tv/kraken |
|
| 55 | 55 | # protected $authMethod = self::HEADER_BEARER; // -> https://api.twitch.tv/helix |
| 56 | 56 | protected $endpointMap = TwitchEndpoints::class; |
| 57 | 57 | protected $apiDocs = 'https://dev.twitch.tv/docs/api/reference/'; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | 'grant_type' => 'client_credentials', |
| 72 | 72 | ]; |
| 73 | 73 | |
| 74 | - if($scopes !== null){ |
|
| 74 | + if ($scopes !== null) { |
|
| 75 | 75 | $params['scope'] = implode($this->scopesDelimiter, $scopes); |
| 76 | 76 | } |
| 77 | 77 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | ->withBody($this->streamFactory->createStream(http_build_query($params, '', '&', PHP_QUERY_RFC1738))) |
| 82 | 82 | ; |
| 83 | 83 | |
| 84 | - foreach($this->authHeaders as $header => $value){ |
|
| 84 | + foreach ($this->authHeaders as $header => $value) { |
|
| 85 | 85 | $request = $request->withAddedHeader($header, $value); |
| 86 | 86 | } |
| 87 | 87 | |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | * @method \Psr\Http\Message\ResponseInterface me() |
| 21 | 21 | * @method \Psr\Http\Message\ResponseInterface user(string $username) |
| 22 | 22 | */ |
| 23 | -class Mixcloud extends OAuth2Provider{ |
|
| 23 | +class Mixcloud extends OAuth2Provider { |
|
| 24 | 24 | |
| 25 | 25 | protected $apiURL = 'https://api.mixcloud.com'; |
| 26 | 26 | protected $authURL = 'https://www.mixcloud.com/oauth/authorize'; |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | * |
| 21 | 21 | * note: a missing slash at the end of the path will end up in a HTTP/301 |
| 22 | 22 | */ |
| 23 | -class MixcloudEndpoints extends EndpointMap{ |
|
| 23 | +class MixcloudEndpoints extends EndpointMap { |
|
| 24 | 24 | |
| 25 | 25 | protected $me = [ |
| 26 | 26 | 'path' => '/me/', |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * @link https://stripe.com/docs/api |
| 19 | 19 | */ |
| 20 | -class StripeEndpoints extends EndpointMap{ |
|
| 20 | +class StripeEndpoints extends EndpointMap { |
|
| 21 | 21 | |
| 22 | 22 | protected $me = [ |
| 23 | 23 | 'path' => '/accounts', |