@@ -39,7 +39,7 @@ |
||
| 39 | 39 | |
| 40 | 40 | $data = parseMetadataResponse($response, 200); |
| 41 | 41 | |
| 42 | - if (! \array_key_exists('issuer', $data)) { |
|
| 42 | + if (!\array_key_exists('issuer', $data)) { |
|
| 43 | 43 | throw new RuntimeException('Invalid metadata content, no "issuer" key found'); |
| 44 | 44 | } |
| 45 | 45 | |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | $endpointUri = $client->getUserinfoEndpoint(); |
| 47 | 47 | |
| 48 | - if (! $endpointUri) { |
|
| 48 | + if (!$endpointUri) { |
|
| 49 | 49 | throw new InvalidArgumentException('Invalid issuer userinfo endpoint'); |
| 50 | 50 | } |
| 51 | 51 | |
@@ -75,13 +75,13 @@ discard block |
||
| 75 | 75 | $payload = $response->getBody()->getContents(); |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | - if (! \is_string($payload)) { |
|
| 78 | + if (!\is_string($payload)) { |
|
| 79 | 79 | throw new RuntimeException('Unable to parse userinfo claims'); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | $claims = \json_decode($payload, true); |
| 83 | 83 | |
| 84 | - if (! \is_array($claims)) { |
|
| 84 | + if (!\is_array($claims)) { |
|
| 85 | 85 | throw new RuntimeException('Unable to parse userinfo claims'); |
| 86 | 86 | } |
| 87 | 87 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | { |
| 58 | 58 | $registrationEndpoint = $issuer->getMetadata()->getRegistrationEndpoint(); |
| 59 | 59 | |
| 60 | - if (! $registrationEndpoint) { |
|
| 60 | + if (!$registrationEndpoint) { |
|
| 61 | 61 | throw new InvalidArgumentException('Issuer does not support dynamic client registration'); |
| 62 | 62 | } |
| 63 | 63 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | $data = parseMetadataResponse($response, 201); |
| 86 | 86 | |
| 87 | - if (! \array_key_exists('client_id', $data)) { |
|
| 87 | + if (!\array_key_exists('client_id', $data)) { |
|
| 88 | 88 | throw new RuntimeException('Registration response did not return a client_id field'); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | $claims = parseMetadataResponse($response, 200); |
| 107 | 107 | |
| 108 | - if (! \array_key_exists('client_id', $claims)) { |
|
| 108 | + if (!\array_key_exists('client_id', $claims)) { |
|
| 109 | 109 | throw new RuntimeException('Registration response did not return a client_id field'); |
| 110 | 110 | } |
| 111 | 111 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | |
| 144 | 144 | $data = parseMetadataResponse($response, 200); |
| 145 | 145 | |
| 146 | - if (! \array_key_exists('client_id', $data)) { |
|
| 146 | + if (!\array_key_exists('client_id', $data)) { |
|
| 147 | 147 | throw new RuntimeException('Registration response did not return a client_id field'); |
| 148 | 148 | } |
| 149 | 149 | |
@@ -147,7 +147,7 @@ |
||
| 147 | 147 | 'code_verifier' => $this->codeVerifier, |
| 148 | 148 | ]; |
| 149 | 149 | |
| 150 | - return \array_filter($data, static function ($value) { |
|
| 150 | + return \array_filter($data, static function($value) { |
|
| 151 | 151 | return null !== $value; |
| 152 | 152 | }); |
| 153 | 153 | } |
@@ -125,7 +125,7 @@ |
||
| 125 | 125 | 'code_verifier' => $this->codeVerifier, |
| 126 | 126 | ]; |
| 127 | 127 | |
| 128 | - return \array_filter($data, static function ($value) { |
|
| 128 | + return \array_filter($data, static function($value) { |
|
| 129 | 129 | return null !== $value; |
| 130 | 130 | }); |
| 131 | 131 | } |
@@ -116,11 +116,11 @@ discard block |
||
| 116 | 116 | /** @var string|null $endpointUri */ |
| 117 | 117 | $endpointUri = $this->getIssuer()->getMetadata()->get($endpointClaim); |
| 118 | 118 | |
| 119 | - if (! $endpointUri) { |
|
| 119 | + if (!$endpointUri) { |
|
| 120 | 120 | return null; |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - if (! \in_array($authMethod, AuthMethodInterface::TLS_METHODS, true)) { |
|
| 123 | + if (!\in_array($authMethod, AuthMethodInterface::TLS_METHODS, true)) { |
|
| 124 | 124 | return $endpointUri; |
| 125 | 125 | } |
| 126 | 126 | |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | { |
| 134 | 134 | $uri = $this->getEndpointUri('token_endpoint'); |
| 135 | 135 | |
| 136 | - if (! $uri) { |
|
| 136 | + if (!$uri) { |
|
| 137 | 137 | throw new RuntimeException('Unable to retrieve the token endpoint'); |
| 138 | 138 | } |
| 139 | 139 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | /** @var boolean|array<string, mixed> $data */ |
| 20 | 20 | $data = \json_decode($response->getBody()->getContents(), true); |
| 21 | 21 | |
| 22 | - if (! \is_array($data)) { |
|
| 22 | + if (!\is_array($data)) { |
|
| 23 | 23 | throw new InvalidArgumentException('Invalid metadata content'); |
| 24 | 24 | } |
| 25 | 25 | |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | function checkServerResponse(ResponseInterface $response, ?int $expectedCode = null) |
| 15 | 15 | { |
| 16 | - if (! $expectedCode && $response->getStatusCode() >= 400) { |
|
| 16 | + if (!$expectedCode && $response->getStatusCode() >= 400) { |
|
| 17 | 17 | throw OAuth2Exception::fromResponse($response); |
| 18 | 18 | } |
| 19 | 19 | |