@@ -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 |
@@ -50,17 +50,17 @@ |
||
50 | 50 | $authResponse = $request->getAttribute(AuthResponseInterface::class); |
51 | 51 | $client = $this->client ?: $request->getAttribute(ClientInterface::class); |
52 | 52 | |
53 | - if (! $client instanceof ClientInterface) { |
|
53 | + if (!$client instanceof ClientInterface) { |
|
54 | 54 | throw new LogicException('No OpenID client provided'); |
55 | 55 | } |
56 | 56 | |
57 | - if (! $authResponse instanceof AuthResponseInterface) { |
|
57 | + if (!$authResponse instanceof AuthResponseInterface) { |
|
58 | 58 | throw new RuntimeException('Unable to get auth token response attribute'); |
59 | 59 | } |
60 | 60 | |
61 | 61 | $code = $authResponse->getCode(); |
62 | 62 | |
63 | - if (! $code) { |
|
63 | + if (!$code) { |
|
64 | 64 | throw new RuntimeException('Unable to get auth code'); |
65 | 65 | } |
66 | 66 |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | { |
44 | 44 | $client = $this->client ?: $request->getAttribute(ClientInterface::class); |
45 | 45 | |
46 | - if (! $client instanceof ClientInterface) { |
|
46 | + if (!$client instanceof ClientInterface) { |
|
47 | 47 | throw new LogicException('No OpenID client provided'); |
48 | 48 | } |
49 | 49 | |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | $code = $claims['code'] ?? null; |
62 | 62 | |
63 | - if (! $code) { |
|
63 | + if (!$code) { |
|
64 | 64 | throw new RuntimeException('Unable to find a code claim to make a token request'); |
65 | 65 | } |
66 | 66 |
@@ -43,17 +43,17 @@ |
||
43 | 43 | $tokenResponse = $request->getAttribute(TokenResponseInterface::class); |
44 | 44 | $client = $this->client ?: $request->getAttribute(ClientInterface::class); |
45 | 45 | |
46 | - if (! $client instanceof ClientInterface) { |
|
46 | + if (!$client instanceof ClientInterface) { |
|
47 | 47 | throw new LogicException('No OpenID client provided'); |
48 | 48 | } |
49 | 49 | |
50 | - if (! $tokenResponse instanceof TokenResponseInterface) { |
|
50 | + if (!$tokenResponse instanceof TokenResponseInterface) { |
|
51 | 51 | throw new RuntimeException('Unable to get token response attribute'); |
52 | 52 | } |
53 | 53 | |
54 | 54 | $accessToken = $tokenResponse->getAccessToken(); |
55 | 55 | |
56 | - if (! $accessToken) { |
|
56 | + if (!$accessToken) { |
|
57 | 57 | throw new RuntimeException(\sprintf( |
58 | 58 | 'Unable to get access token from "%s" attribute', |
59 | 59 | TokenResponseInterface::class |
@@ -20,7 +20,7 @@ |
||
20 | 20 | /** @var bool|array<string, mixed> $data */ |
21 | 21 | $data = \json_decode((string) $response->getBody(), true); |
22 | 22 | |
23 | - if (! \is_array($data)) { |
|
23 | + if (!\is_array($data)) { |
|
24 | 24 | throw new InvalidArgumentException('Invalid metadata content'); |
25 | 25 | } |
26 | 26 |
@@ -19,7 +19,7 @@ |
||
19 | 19 | { |
20 | 20 | $data = \json_decode((string) $request->getBody(), true); |
21 | 21 | |
22 | - if (! \is_array($data)) { |
|
22 | + if (!\is_array($data)) { |
|
23 | 23 | throw new RuntimeException('Unable to decode response body'); |
24 | 24 | } |
25 | 25 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | { |
48 | 48 | $endpointUri = $client->getUserinfoEndpoint(); |
49 | 49 | |
50 | - if (! $endpointUri) { |
|
50 | + if (!$endpointUri) { |
|
51 | 51 | throw new InvalidArgumentException('Invalid issuer userinfo endpoint'); |
52 | 52 | } |
53 | 53 | |
@@ -77,13 +77,13 @@ discard block |
||
77 | 77 | $payload = (string) $response->getBody(); |
78 | 78 | } |
79 | 79 | |
80 | - if (! \is_string($payload)) { |
|
80 | + if (!\is_string($payload)) { |
|
81 | 81 | throw new RuntimeException('Unable to parse userinfo claims'); |
82 | 82 | } |
83 | 83 | |
84 | 84 | $claims = \json_decode($payload, true); |
85 | 85 | |
86 | - if (! \is_array($claims)) { |
|
86 | + if (!\is_array($claims)) { |
|
87 | 87 | throw new RuntimeException('Unable to parse userinfo claims'); |
88 | 88 | } |
89 | 89 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | { |
32 | 32 | $data = \json_decode((string) $response->getBody(), true); |
33 | 33 | |
34 | - if (! \is_array($data) || ! isset($data['error'])) { |
|
34 | + if (!\is_array($data) || !isset($data['error'])) { |
|
35 | 35 | throw new RemoteException($response, $response->getReasonPhrase(), $response->getStatusCode(), $previous); |
36 | 36 | } |
37 | 37 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public static function fromParameters(array $params, Throwable $previous = null): self |
48 | 48 | { |
49 | - if (! \array_key_exists('error', $params)) { |
|
49 | + if (!\array_key_exists('error', $params)) { |
|
50 | 50 | throw new RuntimeException('Invalid OAuth2 exception', 0, $previous); |
51 | 51 | } |
52 | 52 |