Passed
Push — main ( a1d9c6...449c3a )
by smiley
02:06
created
src/GitHub/GitHub.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
  * @method \Psr\Http\Message\ResponseInterface getUser(string $username)
22 22
  * @method \Psr\Http\Message\ResponseInterface me()
23 23
  */
24
-class GitHub extends OAuth2Provider implements CSRFToken{
24
+class GitHub extends OAuth2Provider implements CSRFToken {
25 25
 
26 26
 	const SCOPE_USER             = 'user';
27 27
 	const SCOPE_USER_EMAIL       = 'user:email';
Please login to merge, or discard this patch.
src/Flickr/Flickr.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -243,7 +243,7 @@
 block discarded – undo
243 243
  * @method \Psr\Http\Message\ResponseInterface urlsLookupGroup(array $params = ['url'])
244 244
  * @method \Psr\Http\Message\ResponseInterface urlsLookupUser(array $params = ['url'])
245 245
  */
246
-class Flickr extends OAuth1Provider{
246
+class Flickr extends OAuth1Provider {
247 247
 
248 248
 	public const PERM_READ   = 'read';
249 249
 	public const PERM_WRITE  = 'write';
Please login to merge, or discard this patch.
src/Twitter/TwitterCC.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@
 block discarded – undo
132 132
  * @method \Psr\Http\Message\ResponseInterface usersSuggestionsSlugMembers(string $slug, array $params = ['lang'])
133 133
  * @method \Psr\Http\Message\ResponseInterface verifyCredentials(array $params = ['include_entities', 'skip_status'])
134 134
  */
135
-class TwitterCC extends OAuth2Provider implements ClientCredentials{
135
+class TwitterCC extends OAuth2Provider implements ClientCredentials {
136 136
 
137 137
 	protected const AUTH_ERRMSG = 'TwitterCC only supports Client Credentials Grant, use the Twitter OAuth1 class for authentication instead.';
138 138
 
Please login to merge, or discard this patch.
src/Microsoft/MicrosoftGraph.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@
 block discarded – undo
17 17
 /**
18 18
  * @method \Psr\Http\Message\ResponseInterface me()
19 19
  */
20
-class MicrosoftGraph extends AzureActiveDirectory{
20
+class MicrosoftGraph extends AzureActiveDirectory {
21 21
 
22 22
 	public const SCOPE_USER_READ = 'User.Read';
23 23
 	public const SCOPE_USER_READBASIC_ALL = 'User.ReadBasic.All';
Please login to merge, or discard this patch.
src/functions.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,22 +14,22 @@
 block discarded – undo
14 14
 
15 15
 use function function_exists, hash, realpath, str_replace, strlen, substr;
16 16
 
17
-if(!function_exists(__NAMESPACE__.'\\getProviders')){
17
+if (!function_exists(__NAMESPACE__.'\\getProviders')) {
18 18
 
19 19
 	function getProviders():array{
20 20
 		$providers = [];
21 21
 
22 22
 		/** @var \SplFileInfo $e */
23
-		foreach(new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__, FilesystemIterator::SKIP_DOTS)) as $e){
23
+		foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__, FilesystemIterator::SKIP_DOTS)) as $e) {
24 24
 
25
-			if($e->getExtension() !== 'php' || realpath($e->getPath()) === __DIR__){
25
+			if ($e->getExtension() !== 'php' || realpath($e->getPath()) === __DIR__) {
26 26
 				continue;
27 27
 			}
28 28
 
29 29
 			$class = __NAMESPACE__.str_replace('/', '\\', substr($e->getPathname(), strlen(__DIR__), -4));
30 30
 			$r     = new ReflectionClass($class);
31 31
 
32
-			if(!$r->implementsInterface(OAuthInterface::class) || $r->isAbstract()){
32
+			if (!$r->implementsInterface(OAuthInterface::class) || $r->isAbstract()) {
33 33
 				continue;
34 34
 			}
35 35
 
Please login to merge, or discard this patch.
src/GuildWars2/GuildWars2.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
  * @method \Psr\Http\Message\ResponseInterface wvwUpgrades(array $params = ['lang'])
233 233
  * @method \Psr\Http\Message\ResponseInterface wvwUpgradesId(string $id, array $params = ['lang'])
234 234
  */
235
-class GuildWars2 extends OAuth2Provider{
235
+class GuildWars2 extends OAuth2Provider {
236 236
 
237 237
 	public const SCOPE_ACCOUNT     = 'account';
238 238
 	public const SCOPE_INVENTORIES = 'inventories';
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
 	 */
263 263
 	public function storeGW2Token(string $access_token):AccessToken{
264 264
 
265
-		if(!preg_match('/^[a-f\d\-]{72}$/i', $access_token)){
265
+		if (!preg_match('/^[a-f\d\-]{72}$/i', $access_token)) {
266 266
 			throw new ProviderException('invalid token');
267 267
 		}
268 268
 
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
 		$tokeninfo = get_json($this->http->sendRequest($request));
274 274
 
275
-		if(isset($tokeninfo->id) && \strpos($access_token, $tokeninfo->id) === 0){
275
+		if (isset($tokeninfo->id) && \strpos($access_token, $tokeninfo->id) === 0) {
276 276
 
277 277
 			$token = new AccessToken([
278 278
 				'provider'     => $this->serviceName,
Please login to merge, or discard this patch.
src/LastFM/LastFM.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -164,11 +164,9 @@
 block discarded – undo
164 164
 
165 165
 		if(!$data || !is_array($data)){
166 166
 			throw new ProviderException('unable to parse token response');
167
-		}
168
-		elseif(isset($data['error'])){
167
+		} elseif(isset($data['error'])){
169 168
 			throw new ProviderException('error retrieving access token: '.$data['message']);
170
-		}
171
-		elseif(!isset($data['session']['key'])){
169
+		} elseif(!isset($data['session']['key'])){
172 170
 			throw new ProviderException('token missing');
173 171
 		}
174 172
 
Please login to merge, or discard this patch.
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 use chillerlan\OAuth\Core\{AccessToken, OAuthProvider, ProviderException};
16 16
 use Psr\Http\Message\{RequestInterface, ResponseInterface, UriInterface};
17 17
 
18
-use function array_merge, http_build_query, in_array, is_array,ksort, md5;
18
+use function array_merge, http_build_query, in_array, is_array, ksort, md5;
19 19
 use function chillerlan\HTTP\Psr7\{get_json, merge_query};
20 20
 
21 21
 use const PHP_QUERY_RFC1738;
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
  * @method \Psr\Http\Message\ResponseInterface userGetWeeklyChartList(array $params = ['user'])
76 76
  * @method \Psr\Http\Message\ResponseInterface userGetWeeklyTrackChart(array $params = ['from', 'to', 'user'])
77 77
  */
78
-class LastFM extends OAuthProvider{
78
+class LastFM extends OAuthProvider {
79 79
 
80 80
 	public const PERIOD_OVERALL = 'overall';
81 81
 	public const PERIOD_7DAY    = '7day';
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 		self::PERIOD_12MONTH,
94 94
 	];
95 95
 
96
-	protected string $authURL        = 'https://www.last.fm/api/auth';
96
+	protected string $authURL = 'https://www.last.fm/api/auth';
97 97
 	protected ?string $apiURL         = 'https://ws.audioscrobbler.com/2.0';
98 98
 	protected ?string $userRevokeURL  = 'https://www.last.fm/settings/applications';
99 99
 	protected ?string $endpointMap    = LastFMEndpoints::class;
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
 
123 123
 		$signature = '';
124 124
 
125
-		foreach($params as $k => $v){
126
-			if(!in_array($k, ['format', 'callback'])){
125
+		foreach ($params as $k => $v) {
126
+			if (!in_array($k, ['format', 'callback'])) {
127 127
 				$signature .= $k.$v;
128 128
 			}
129 129
 		}
@@ -162,13 +162,13 @@  discard block
 block discarded – undo
162 162
 	protected function parseTokenResponse(ResponseInterface $response):AccessToken{
163 163
 		$data = get_json($response, true);
164 164
 
165
-		if(!$data || !is_array($data)){
165
+		if (!$data || !is_array($data)) {
166 166
 			throw new ProviderException('unable to parse token response');
167 167
 		}
168
-		elseif(isset($data['error'])){
168
+		elseif (isset($data['error'])) {
169 169
 			throw new ProviderException('error retrieving access token: '.$data['message']);
170 170
 		}
171
-		elseif(!isset($data['session']['key'])){
171
+		elseif (!isset($data['session']['key'])) {
172 172
 			throw new ProviderException('token missing');
173 173
 		}
174 174
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 
209 209
 		$params['api_sig'] = $this->getSignature($params);
210 210
 
211
-		if($method === 'POST'){
211
+		if ($method === 'POST') {
212 212
 			$body   = $params;
213 213
 			$params = [];
214 214
 		}
@@ -216,11 +216,11 @@  discard block
 block discarded – undo
216 216
 		/** @phan-suppress-next-line PhanTypeMismatchArgumentNullable */
217 217
 		$request = $this->requestFactory->createRequest($method, merge_query($this->apiURL, $params));
218 218
 
219
-		foreach(array_merge($this->apiHeaders, $headers ?? []) as $header => $value){
219
+		foreach (array_merge($this->apiHeaders, $headers ?? []) as $header => $value) {
220 220
 			$request = $request->withAddedHeader($header, $value);
221 221
 		}
222 222
 
223
-		if($method === 'POST'){
223
+		if ($method === 'POST') {
224 224
 			$request = $request->withHeader('Content-Type', 'application/x-www-form-urlencoded');
225 225
 			$body    = $this->streamFactory->createStream(http_build_query($body, '', '&', PHP_QUERY_RFC1738));
226 226
 			$request = $request->withBody($body);
Please login to merge, or discard this patch.
src/Microsoft/AzureActiveDirectory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
 
19 19
 /**
20 20
  */
21
-abstract class AzureActiveDirectory extends OAuth2Provider implements CSRFToken{
21
+abstract class AzureActiveDirectory extends OAuth2Provider implements CSRFToken {
22 22
 
23 23
 	public const SCOPE_OPENID         = 'openid';
24 24
 	public const SCOPE_OPENID_EMAIL   = 'email';
Please login to merge, or discard this patch.
src/Amazon/Amazon.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 
17 17
 namespace chillerlan\OAuth\Providers\Amazon;
18 18
 
19
-use chillerlan\OAuth\Core\{CSRFToken, OAuth2Provider, TokenRefresh,};
19
+use chillerlan\OAuth\Core\{CSRFToken, OAuth2Provider, TokenRefresh, };
20 20
 
21 21
 /**
22 22
  * @method \Psr\Http\Message\ResponseInterface userProfile()
Please login to merge, or discard this patch.