@@ -51,7 +51,7 @@ |
||
| 51 | 51 | { |
| 52 | 52 | if ($client instanceof RegisteredClient && is_array($client->getMetadata()->getScope())) { |
| 53 | 53 | $supportedScopes = explode(' ', $client->getMetadata()->getScope()); |
| 54 | - if(empty($scopes) || !empty(array_diff($scopes, $supportedScopes))) { |
|
| 54 | + if (empty($scopes) || !empty(array_diff($scopes, $supportedScopes))) { |
|
| 55 | 55 | throw new OAuthException('invalid_scope', |
| 56 | 56 | 'The request scope is invalid. Supported scopes : '.$client->getMetadata()->getScope(), |
| 57 | 57 | 'https://tools.ietf.org/html/rfc6749#section-4.1'); |
@@ -212,7 +212,7 @@ |
||
| 212 | 212 | } |
| 213 | 213 | else { |
| 214 | 214 | if (count($redirectUris) == 1) { |
| 215 | - $redirectUri = $redirectUris[0]; |
|
| 215 | + $redirectUri = $redirectUris[0]; |
|
| 216 | 216 | } |
| 217 | 217 | else { |
| 218 | 218 | throw new OAuthException('invalid_request', 'The request is missing the required parameter redirect_uri.', |
@@ -124,14 +124,14 @@ discard block |
||
| 124 | 124 | * If the Authorization Server encounters any error, it MUST return an error response, per Section 3.1.2.6. |
| 125 | 125 | */ |
| 126 | 126 | $uri = $this->getRedirectUri(); |
| 127 | - if(!empty($this->state)) { |
|
| 127 | + if (!empty($this->state)) { |
|
| 128 | 128 | $uri = Uri::withQueryValue($uri, 'state', $this->state); |
| 129 | 129 | } |
| 130 | 130 | $uri = Uri::withQueryValue($uri, 'error', $e->getError()); |
| 131 | - if($e->getErrorDescription()) { |
|
| 131 | + if ($e->getErrorDescription()) { |
|
| 132 | 132 | $uri = Uri::withQueryValue($uri, 'error_description', $e->getErrorDescription()); |
| 133 | 133 | } |
| 134 | - if($e->getErrorUri()) { |
|
| 134 | + if ($e->getErrorUri()) { |
|
| 135 | 135 | $uri = Uri::withQueryValue($uri, 'error_uri', $e->getErrorUri()); |
| 136 | 136 | } |
| 137 | 137 | return new Response(302, ['Location' => $uri]); |
@@ -173,7 +173,7 @@ discard block |
||
| 173 | 173 | |
| 174 | 174 | $supportedResponseTypes = $this->client->getMetadata()->getResponseTypes() ?: ['code']; |
| 175 | 175 | foreach (explode(' ', $requestData['response_type']) as $responseType) { |
| 176 | - if(!in_array($responseType, $supportedResponseTypes)) { |
|
| 176 | + if (!in_array($responseType, $supportedResponseTypes)) { |
|
| 177 | 177 | throw new OAuthException('unsupported_response_type', |
| 178 | 178 | 'The authorization server does not support obtaining an authorization code using this method.', |
| 179 | 179 | 'https://tools.ietf.org/html/rfc6749#section-4.1'); |
@@ -209,12 +209,10 @@ discard block |
||
| 209 | 209 | throw new OAuthException('invalid_request', 'The request includes the invalid parameter redirect_uri.', |
| 210 | 210 | 'https://tools.ietf.org/html/rfc6749#section-4.1'); |
| 211 | 211 | } |
| 212 | - } |
|
| 213 | - else { |
|
| 212 | + } else { |
|
| 214 | 213 | if (count($redirectUris) == 1) { |
| 215 | 214 | $redirectUri = $redirectUris[0]; |
| 216 | - } |
|
| 217 | - else { |
|
| 215 | + } else { |
|
| 218 | 216 | throw new OAuthException('invalid_request', 'The request is missing the required parameter redirect_uri.', |
| 219 | 217 | 'https://tools.ietf.org/html/rfc6749#section-4.1'); |
| 220 | 218 | } |
@@ -222,8 +220,7 @@ discard block |
||
| 222 | 220 | try { |
| 223 | 221 | |
| 224 | 222 | $this->redirectUri = new Uri($redirectUri); |
| 225 | - } |
|
| 226 | - catch (\InvalidArgumentException $e) { |
|
| 223 | + } catch (\InvalidArgumentException $e) { |
|
| 227 | 224 | throw new OAuthException('invalid_request', 'The request includes the malformed parameter redirect_uri.', |
| 228 | 225 | 'https://tools.ietf.org/html/rfc6749#section-4.1'); |
| 229 | 226 | } |