@@ -25,7 +25,7 @@ |
||
25 | 25 | |
26 | 26 | function getClaims() : array |
27 | 27 | { |
28 | - return $this->claims; |
|
28 | + return $this->claims; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | /** |
@@ -16,6 +16,6 @@ |
||
16 | 16 | { |
17 | 17 | function buildResponse(array $requestData, array $responseData): ResponseInterface |
18 | 18 | { |
19 | - return new Response(); |
|
19 | + return new Response(); |
|
20 | 20 | } |
21 | 21 | } |
22 | 22 | \ No newline at end of file |
@@ -96,11 +96,11 @@ |
||
96 | 96 | * @throws \Exception |
97 | 97 | */ |
98 | 98 | public function validate() { |
99 | - if(!$this->responseType) { |
|
99 | + if (!$this->responseType) { |
|
100 | 100 | throw new \Exception('Missing response_type parameter'); |
101 | 101 | } |
102 | 102 | |
103 | - if(!$this->clientId) { |
|
103 | + if (!$this->clientId) { |
|
104 | 104 | throw new \Exception('Missing client_id parameter'); |
105 | 105 | } |
106 | 106 | return true; |
@@ -37,18 +37,18 @@ discard block |
||
37 | 37 | ?string $errorUri = null, ?string $state = null) |
38 | 38 | { |
39 | 39 | if ($this->containsNotAsciiChar($error)) { |
40 | - throw new \Exception('Malformed error type. Expect ascii string. Got : ' . $error); |
|
40 | + throw new \Exception('Malformed error type. Expect ascii string. Got : '.$error); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | if (!in_array($error, self::errors)) { |
44 | - throw new \Exception('Unexpected error type. Expect one of : ' . implode(', ', self::errors)); |
|
44 | + throw new \Exception('Unexpected error type. Expect one of : '.implode(', ', self::errors)); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | $redirectUri = Uri::withQueryValue($redirectUri, 'error', $error); |
48 | 48 | |
49 | 49 | if ($errorDescription) { |
50 | 50 | if ($this->containsNotAsciiChar($errorDescription)) { |
51 | - throw new \Exception('Malformed error description. Expect ascii string. Got : ' . $errorDescription); |
|
51 | + throw new \Exception('Malformed error description. Expect ascii string. Got : '.$errorDescription); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | $redirectUri = Uri::withQueryValue($redirectUri, 'error_description', $errorDescription); |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | |
57 | 57 | if ($errorUri) { |
58 | 58 | if ($this->containsNotAsciiChar($errorUri)) { |
59 | - throw new \Exception('Malformed error uri. Expect ascii string. Got : ' . $errorUri); |
|
59 | + throw new \Exception('Malformed error uri. Expect ascii string. Got : '.$errorUri); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | $redirectUri = Uri::withQueryValue($redirectUri, 'error_uri', $errorUri); |
63 | 63 | } |
64 | 64 | |
65 | - if($state) { |
|
65 | + if ($state) { |
|
66 | 66 | $redirectUri = Uri::withQueryValue($redirectUri, 'state', $state); |
67 | 67 | } |
68 | 68 |
@@ -94,10 +94,10 @@ |
||
94 | 94 | */ |
95 | 95 | static public function createFromServerRequest(ServerRequestInterface $request) |
96 | 96 | { |
97 | - if(!isset($request->getParsedBody()['grant_type'])) { |
|
97 | + if (!isset($request->getParsedBody()['grant_type'])) { |
|
98 | 98 | throw new \Exception('Missing a required parameter : grant_type'); |
99 | 99 | } |
100 | - if(!isset($request->getParsedBody()['code'])) { |
|
100 | + if (!isset($request->getParsedBody()['code'])) { |
|
101 | 101 | throw new \Exception('Missing a required parameter : code'); |
102 | 102 | } |
103 | 103 |
@@ -37,25 +37,25 @@ |
||
37 | 37 | public function __construct(string $error, ?string $errorDescription = null, ?string $errorUri = null, int $status = 400, array $headers = []) |
38 | 38 | { |
39 | 39 | if ($this->containsNotAsciiChar($error)) { |
40 | - throw new \Exception('Malformed error type. Expect ascii string. Got : ' . $error); |
|
40 | + throw new \Exception('Malformed error type. Expect ascii string. Got : '.$error); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | if (!in_array($error, self::errors)) { |
44 | - throw new \Exception('Unexpected error type. Expect one of : ' . implode(', ', self::errors)); |
|
44 | + throw new \Exception('Unexpected error type. Expect one of : '.implode(', ', self::errors)); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | $data = ['error' => $error]; |
48 | 48 | |
49 | 49 | if ($errorDescription) { |
50 | 50 | if ($this->containsNotAsciiChar($errorDescription)) { |
51 | - throw new \Exception('Malformed error description. Expect ascii string. Got : ' . $errorDescription); |
|
51 | + throw new \Exception('Malformed error description. Expect ascii string. Got : '.$errorDescription); |
|
52 | 52 | } |
53 | 53 | $data['error_description'] = $errorDescription; |
54 | 54 | } |
55 | 55 | |
56 | 56 | if ($errorUri) { |
57 | 57 | if ($this->containsNotAsciiChar($errorUri)) { |
58 | - throw new \Exception('Malformed error uri. Expect ascii string. Got : ' . $errorUri); |
|
58 | + throw new \Exception('Malformed error uri. Expect ascii string. Got : '.$errorUri); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | $data['error_uri'] = $errorUri; |
@@ -44,7 +44,7 @@ |
||
44 | 44 | * @throws OAuthException |
45 | 45 | */ |
46 | 46 | public function handle(ServerRequestInterface $request, ResourceOwnerInterface $resourceOwner, |
47 | - RegisteredClient $client, ?array $scope = null, ?array $extendedResponseTypes = null): array |
|
47 | + RegisteredClient $client, ?array $scope = null, ?array $extendedResponseTypes = null): array |
|
48 | 48 | { |
49 | 49 | if (is_array($client->getSupportedGrantTypes()) && !in_array('authorization_code', $client->getSupportedGrantTypes())) { |
50 | 50 | throw new OAuthException('unauthorized_client', |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * @return array |
29 | 29 | */ |
30 | 30 | public function handle(ServerRequestInterface $request, ResourceOwnerInterface $resourceOwner, |
31 | - RegisteredClient $client, ?array $scope = null, ?array $extendedResponseTypes = null): array; |
|
31 | + RegisteredClient $client, ?array $scope = null, ?array $extendedResponseTypes = null): array; |
|
32 | 32 | |
33 | 33 | public function getDefaultResponseMode(): string; |
34 | 34 | public function isQueryResponseModeSupported(): bool; |
@@ -14,5 +14,5 @@ |
||
14 | 14 | interface ScopePolicyInterface |
15 | 15 | { |
16 | 16 | // function check(array $scope, ClientInterface $client): bool ; |
17 | - function getDefaultScopes(ClientInterface $client) : ?array ; |
|
17 | + function getDefaultScopes(ClientInterface $client) : ?array; |
|
18 | 18 | } |
19 | 19 | \ No newline at end of file |