@@ -19,7 +19,7 @@ |
||
| 19 | 19 | if ('POST' === $method) { |
| 20 | 20 | $params = $serverRequest->getParsedBody(); |
| 21 | 21 | |
| 22 | - if (! \is_array($params)) { |
|
| 22 | + if (!\is_array($params)) { |
|
| 23 | 23 | throw new RuntimeException('Invalid parsed body'); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | ?JWSBuilder $jwsBuilder = null, |
| 33 | 33 | ?Serializer $jwsSerializer = null |
| 34 | 34 | ) { |
| 35 | - if (! $jwsBuilder && ! \class_exists(HS256::class)) { |
|
| 35 | + if (!$jwsBuilder && !\class_exists(HS256::class)) { |
|
| 36 | 36 | throw new LogicException('To use the client_secret_jwt auth method you should install web-token/jwt-signature-algorithm-hmac package'); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $clientId = $client->getMetadata()->getClientId(); |
| 54 | 54 | $clientSecret = $client->getMetadata()->getClientSecret(); |
| 55 | 55 | |
| 56 | - if (! $clientSecret) { |
|
| 56 | + if (!$clientSecret) { |
|
| 57 | 57 | throw new InvalidArgumentException($this->getSupportedMethod() . ' cannot be used without client_secret metadata'); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -61,7 +61,7 @@ |
||
| 61 | 61 | |
| 62 | 62 | $jwk = $this->jwk ?: $client->getJWKS()->selectKey('sig'); |
| 63 | 63 | |
| 64 | - if (! $jwk) { |
|
| 64 | + if (!$jwk) { |
|
| 65 | 65 | throw new RuntimeException('Unable to get a client signature jwk'); |
| 66 | 66 | } |
| 67 | 67 | |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function checkClaim($value): void |
| 30 | 30 | { |
| 31 | - if (! \is_int($value)) { |
|
| 31 | + if (!\is_int($value)) { |
|
| 32 | 32 | throw new InvalidClaimException('"auth_time" must be an integer.', self::CLAIM_NAME, $value); |
| 33 | 33 | } |
| 34 | 34 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | ): array { |
| 53 | 53 | $registrationEndpoint = $issuer->getMetadata()->getRegistrationEndpoint(); |
| 54 | 54 | |
| 55 | - if (! $registrationEndpoint) { |
|
| 55 | + if (!$registrationEndpoint) { |
|
| 56 | 56 | throw new InvalidArgumentException('Issuer does not support dynamic client registration'); |
| 57 | 57 | } |
| 58 | 58 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | $data = parse_metadata_response($response, 201); |
| 82 | 82 | |
| 83 | - if (! \array_key_exists('client_id', $data)) { |
|
| 83 | + if (!\array_key_exists('client_id', $data)) { |
|
| 84 | 84 | throw new RuntimeException('Registration response did not return a client_id field'); |
| 85 | 85 | } |
| 86 | 86 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | |
| 102 | 102 | $claims = parse_metadata_response($response, 200); |
| 103 | 103 | |
| 104 | - if (! \array_key_exists('client_id', $claims)) { |
|
| 104 | + if (!\array_key_exists('client_id', $claims)) { |
|
| 105 | 105 | throw new RuntimeException('Registration response did not return a client_id field'); |
| 106 | 106 | } |
| 107 | 107 | |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | $data = parse_metadata_response($response, 200); |
| 141 | 141 | |
| 142 | - if (! \array_key_exists('client_id', $data)) { |
|
| 142 | + if (!\array_key_exists('client_id', $data)) { |
|
| 143 | 143 | throw new RuntimeException('Registration response did not return a client_id field'); |
| 144 | 144 | } |
| 145 | 145 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | unset($params[$key]); |
| 99 | 99 | } elseif ('claims' === $key && (\is_array($value) || $value instanceof JsonSerializable)) { |
| 100 | 100 | $params['claims'] = \json_encode($value); |
| 101 | - } elseif (! \is_string($value)) { |
|
| 101 | + } elseif (!\is_string($value)) { |
|
| 102 | 102 | $params[$key] = (string) $value; |
| 103 | 103 | } |
| 104 | 104 | } |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $this->tokenSetVerifier->validate($tokenSet, $client, $authSession, true, $maxAge); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - if (! $tokenSet->getCode()) { |
|
| 135 | + if (!$tokenSet->getCode()) { |
|
| 136 | 136 | return $tokenSet; |
| 137 | 137 | } |
| 138 | 138 | |
@@ -149,15 +149,15 @@ discard block |
||
| 149 | 149 | ): TokenSetInterface { |
| 150 | 150 | $code = $tokenSet->getCode(); |
| 151 | 151 | |
| 152 | - if (! $code) { |
|
| 152 | + if (!$code) { |
|
| 153 | 153 | throw new RuntimeException('Unable to fetch token without a code'); |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | - if (! $redirectUri) { |
|
| 156 | + if (!$redirectUri) { |
|
| 157 | 157 | $redirectUri = $client->getMetadata()->getRedirectUris()[0] ?? null; |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - if (! $redirectUri) { |
|
| 160 | + if (!$redirectUri) { |
|
| 161 | 161 | throw new InvalidArgumentException('A redirect_uri should be provided'); |
| 162 | 162 | } |
| 163 | 163 | |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | 'redirect_uri' => $redirectUri, |
| 168 | 168 | ]); |
| 169 | 169 | |
| 170 | - if (! ($params['id_token'] ?? null)) { |
|
| 170 | + if (!($params['id_token'] ?? null)) { |
|
| 171 | 171 | return TokenSet::fromParams($params); |
| 172 | 172 | } |
| 173 | 173 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | { |
| 57 | 57 | $endpointUri = $client->getUserinfoEndpoint(); |
| 58 | 58 | |
| 59 | - if (! $endpointUri) { |
|
| 59 | + if (!$endpointUri) { |
|
| 60 | 60 | throw new InvalidArgumentException('Invalid issuer userinfo endpoint'); |
| 61 | 61 | } |
| 62 | 62 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | $claims = \json_decode($payload, true); |
| 89 | 89 | |
| 90 | - if (! \is_array($claims)) { |
|
| 90 | + if (!\is_array($claims)) { |
|
| 91 | 91 | throw new RuntimeException('Unable to parse userinfo claims'); |
| 92 | 92 | } |
| 93 | 93 | |