@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | * @var AuthenticatorInterface $authenticator |
31 | 31 | */ |
32 | 32 | foreach ($this->authenticators as $authenticator) { |
33 | - if($authenticator->requireAuthentication($client)) { |
|
33 | + if ($authenticator->requireAuthentication($client)) { |
|
34 | 34 | return true; |
35 | 35 | } |
36 | 36 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @var AuthenticatorInterface $authenticator |
44 | 44 | */ |
45 | 45 | foreach ($this->authenticators as $authenticator) { |
46 | - if($client = $authenticator->authenticate($request)) { |
|
46 | + if ($client = $authenticator->authenticate($request)) { |
|
47 | 47 | return $client; |
48 | 48 | } |
49 | 49 | } |
@@ -36,25 +36,25 @@ |
||
36 | 36 | public function __construct(string $error, ?string $errorDescription = null, ?string $errorUri = null, int $status = 400, array $headers = []) |
37 | 37 | { |
38 | 38 | if ($this->containsNotAsciiChar($error)) { |
39 | - throw new \Exception('Malformed error type. Expect ascii string. Got : ' . $error); |
|
39 | + throw new \Exception('Malformed error type. Expect ascii string. Got : '.$error); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | if (!in_array($error, self::errors)) { |
43 | - throw new \Exception('Unexpected error type. Expect one of : ' . implode(', ', self::errors)); |
|
43 | + throw new \Exception('Unexpected error type. Expect one of : '.implode(', ', self::errors)); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | $data = ['error' => $error]; |
47 | 47 | |
48 | 48 | if ($errorDescription) { |
49 | 49 | if ($this->containsNotAsciiChar($errorDescription)) { |
50 | - throw new \Exception('Malformed error description. Expect ascii string. Got : ' . $errorDescription); |
|
50 | + throw new \Exception('Malformed error description. Expect ascii string. Got : '.$errorDescription); |
|
51 | 51 | } |
52 | 52 | $data['error_description'] = $errorDescription; |
53 | 53 | } |
54 | 54 | |
55 | 55 | if ($errorUri) { |
56 | 56 | if ($this->containsNotAsciiChar($errorUri)) { |
57 | - throw new \Exception('Malformed error uri. Expect ascii string. Got : ' . $errorUri); |
|
57 | + throw new \Exception('Malformed error uri. Expect ascii string. Got : '.$errorUri); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | $data['error_uri'] = $errorDescription; |
@@ -10,8 +10,6 @@ |
||
10 | 10 | |
11 | 11 | |
12 | 12 | use GuzzleHttp\Psr7\Response; |
13 | -use GuzzleHttp\Psr7\Uri; |
|
14 | -use Psr\Http\Message\UriInterface; |
|
15 | 13 | |
16 | 14 | class ErrorResponse extends Response |
17 | 15 | { |
@@ -36,18 +36,18 @@ discard block |
||
36 | 36 | public function __construct(UriInterface $redirectUri, string $error, ?string $errorDescription = null, ?string $errorUri = null) |
37 | 37 | { |
38 | 38 | if ($this->containsNotAsciiChar($error)) { |
39 | - throw new \Exception('Malformed error type. Expect ascii string. Got : ' . $error); |
|
39 | + throw new \Exception('Malformed error type. Expect ascii string. Got : '.$error); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | if (!in_array($error, self::errors)) { |
43 | - throw new \Exception('Unexpected error type. Expect one of : ' . implode(', ', self::errors)); |
|
43 | + throw new \Exception('Unexpected error type. Expect one of : '.implode(', ', self::errors)); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | $redirectUri = Uri::withQueryValue($redirectUri, 'error', $error); |
47 | 47 | |
48 | 48 | if ($errorDescription) { |
49 | 49 | if ($this->containsNotAsciiChar($errorDescription)) { |
50 | - throw new \Exception('Malformed error description. Expect ascii string. Got : ' . $errorDescription); |
|
50 | + throw new \Exception('Malformed error description. Expect ascii string. Got : '.$errorDescription); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | $redirectUri = Uri::withQueryValue($redirectUri, 'error_description', $errorDescription); |
@@ -55,7 +55,7 @@ discard block |
||
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 | $redirectUri = Uri::withQueryValue($redirectUri, 'error_uri', $errorUri); |
@@ -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; |
@@ -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,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 |
@@ -31,7 +31,7 @@ |
||
31 | 31 | * @return array |
32 | 32 | */ |
33 | 33 | public function handle(ServerRequestInterface $request, ResourceOwnerInterface $resourceOwner, |
34 | - RegisteredClient $client, ?array $scope = null): array; |
|
34 | + RegisteredClient $client, ?array $scope = null): array; |
|
35 | 35 | |
36 | 36 | public function getDefaultResponseMode(): string; |
37 | 37 |
@@ -31,7 +31,7 @@ |
||
31 | 31 | * @return array |
32 | 32 | */ |
33 | 33 | public function handle(ServerRequestInterface $request, ResourceOwnerInterface $resourceOwner, |
34 | - RegisteredClient $client, ?array $scope = null): array |
|
34 | + RegisteredClient $client, ?array $scope = null): array |
|
35 | 35 | { |
36 | 36 | |
37 | 37 | } |
@@ -221,7 +221,7 @@ |
||
221 | 221 | if (!$scopePolicyManager->checkScope($client, $scope)) { |
222 | 222 | $supportedScopes = implode(', ', $scopePolicyManager->getSupportedScopes($client)); |
223 | 223 | throw new OAuthException('invalid_scope', |
224 | - 'Some of requested scopes are not supported. Scope supported : ' . $supportedScopes, |
|
224 | + 'Some of requested scopes are not supported. Scope supported : '.$supportedScopes, |
|
225 | 225 | 'https://tools.ietf.org/html/rfc6749#section-4.1'); |
226 | 226 | } |
227 | 227 |