@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | { |
| 42 | 42 | $authRequest = $request->getAttribute(AuthRequestInterface::class); |
| 43 | 43 | |
| 44 | - if (! $authRequest instanceof AuthRequestInterface) { |
|
| 44 | + if (!$authRequest instanceof AuthRequestInterface) { |
|
| 45 | 45 | throw new RuntimeException('Unable to find a valid attribute for ' . AuthRequestInterface::class); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | $client = $this->client ?: $request->getAttribute(ClientInterface::class); |
| 65 | 65 | |
| 66 | - if (! $client instanceof ClientInterface) { |
|
| 66 | + if (!$client instanceof ClientInterface) { |
|
| 67 | 67 | throw new LogicException('No OpenID client provided'); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -37,11 +37,11 @@ |
||
| 37 | 37 | $tokenSet = $request->getAttribute(TokenSetInterface::class); |
| 38 | 38 | $client = $this->client ?: $request->getAttribute(ClientInterface::class); |
| 39 | 39 | |
| 40 | - if (! $client instanceof ClientInterface) { |
|
| 40 | + if (!$client instanceof ClientInterface) { |
|
| 41 | 41 | throw new LogicException('No OpenID client provided'); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - if (! $tokenSet instanceof TokenSetInterface) { |
|
| 44 | + if (!$tokenSet instanceof TokenSetInterface) { |
|
| 45 | 45 | throw new RuntimeException('Unable to get token response attribute'); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $data = json_decode((string) $response->getBody(), true); |
| 38 | 38 | |
| 39 | - if (! is_array($data) || ! isset($data['error'])) { |
|
| 39 | + if (!is_array($data) || !isset($data['error'])) { |
|
| 40 | 40 | throw new RemoteException($response, $response->getReasonPhrase(), $previous); |
| 41 | 41 | } |
| 42 | 42 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | public static function fromParameters(array $params, Throwable $previous = null): self |
| 53 | 53 | { |
| 54 | - if (! array_key_exists('error', $params)) { |
|
| 54 | + if (!array_key_exists('error', $params)) { |
|
| 55 | 55 | throw new InvalidArgumentException('Invalid OAuth2 exception', 0, $previous); |
| 56 | 56 | } |
| 57 | 57 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function checkClaim($value): void |
| 32 | 32 | { |
| 33 | - if (! is_int($value)) { |
|
| 33 | + if (!is_int($value)) { |
|
| 34 | 34 | throw new InvalidClaimException('"auth_time" must be an integer.', self::CLAIM_NAME, $value); |
| 35 | 35 | } |
| 36 | 36 | |
@@ -16,15 +16,15 @@ |
||
| 16 | 16 | $claimSources = $claims['_claim_sources'] ?? null; |
| 17 | 17 | $claimNames = $claims['_claim_names'] ?? null; |
| 18 | 18 | |
| 19 | - if (! is_array($claimSources)) { |
|
| 19 | + if (!is_array($claimSources)) { |
|
| 20 | 20 | return $claims; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - if (! is_array($claimNames)) { |
|
| 23 | + if (!is_array($claimNames)) { |
|
| 24 | 24 | return $claims; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - $aggregatedSources = array_filter($claimSources, static function ($value) { |
|
| 27 | + $aggregatedSources = array_filter($claimSources, static function($value) { |
|
| 28 | 28 | return null !== ($value['JWT'] ?? null); |
| 29 | 29 | }); |
| 30 | 30 | |
@@ -44,15 +44,15 @@ |
||
| 44 | 44 | $claimSources = $claims['_claim_sources'] ?? null; |
| 45 | 45 | $claimNames = $claims['_claim_names'] ?? null; |
| 46 | 46 | |
| 47 | - if (! is_array($claimSources)) { |
|
| 47 | + if (!is_array($claimSources)) { |
|
| 48 | 48 | return $claims; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | - if (! is_array($claimNames)) { |
|
| 51 | + if (!is_array($claimNames)) { |
|
| 52 | 52 | return $claims; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $distributedSources = array_filter($claimSources, static function ($value) { |
|
| 55 | + $distributedSources = array_filter($claimSources, static function($value) { |
|
| 56 | 56 | return null !== ($value['endpoint'] ?? null); |
| 57 | 57 | }); |
| 58 | 58 | |
@@ -97,11 +97,11 @@ |
||
| 97 | 97 | protected function assignClaims(array $claims, array $sourceNames, array $sources): array |
| 98 | 98 | { |
| 99 | 99 | foreach ($sourceNames as $claim => $inSource) { |
| 100 | - if (! array_key_exists($inSource, $sources)) { |
|
| 100 | + if (!array_key_exists($inSource, $sources)) { |
|
| 101 | 101 | continue; |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - if (! $sources[$inSource][$claim]) { |
|
| 104 | + if (!$sources[$inSource][$claim]) { |
|
| 105 | 105 | throw new RuntimeException(sprintf('Unable to find claim "%s" in source "%s"', $claim, $inSource)); |
| 106 | 106 | } |
| 107 | 107 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $header = array_filter([ |
| 123 | 123 | 'alg' => $alg, |
| 124 | 124 | 'typ' => 'JWT', |
| 125 | - 'kid' => ! $ktyIsOct && $jwk->has('kid') ? $jwk->get('kid') : null, |
|
| 125 | + 'kid' => !$ktyIsOct && $jwk->has('kid') ? $jwk->get('kid') : null, |
|
| 126 | 126 | ]); |
| 127 | 127 | |
| 128 | 128 | $jws = $this->jwsBuilder->create() |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | 'alg' => $alg, |
| 169 | 169 | 'enc' => $enc, |
| 170 | 170 | 'cty' => 'JWT', |
| 171 | - 'kid' => ! $ktyIsOct && $jwk->has('kid') ? $jwk->get('kid') : null, |
|
| 171 | + 'kid' => !$ktyIsOct && $jwk->has('kid') ? $jwk->get('kid') : null, |
|
| 172 | 172 | ]); |
| 173 | 173 | |
| 174 | 174 | $jwe = $this->jweBuilder->create() |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | function normalize_webfinger(string $input): string |
| 20 | 20 | { |
| 21 | - $hasScheme = static function (string $resource): bool { |
|
| 21 | + $hasScheme = static function(string $resource): bool { |
|
| 22 | 22 | if (false !== strpos($resource, '://')) { |
| 23 | 23 | return true; |
| 24 | 24 | } |
@@ -31,10 +31,10 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | $hostOrPort = substr($resource, $index + 1); |
| 33 | 33 | |
| 34 | - return ! (bool) preg_match('/^\d+$/', $hostOrPort); |
|
| 34 | + return !(bool) preg_match('/^\d+$/', $hostOrPort); |
|
| 35 | 35 | }; |
| 36 | 36 | |
| 37 | - $acctSchemeAssumed = static function (string $input): bool { |
|
| 37 | + $acctSchemeAssumed = static function(string $input): bool { |
|
| 38 | 38 | if (false === strpos($input, '@')) { |
| 39 | 39 | return false; |
| 40 | 40 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | /** @var string $host */ |
| 44 | 44 | $host = array_pop($parts); |
| 45 | 45 | |
| 46 | - return ! (bool) preg_match('/[:\/?]+/', $host); |
|
| 46 | + return !(bool) preg_match('/[:\/?]+/', $host); |
|
| 47 | 47 | }; |
| 48 | 48 | |
| 49 | 49 | if ($hasScheme($input)) { |