@@ -238,8 +238,7 @@ |
||
| 238 | 238 | |
| 239 | 239 | if($isImplicitResponseType) { |
| 240 | 240 | $redirectUri = $redirectUri->withFragment(http_build_query($params)); |
| 241 | - } |
|
| 242 | - else { |
|
| 241 | + } else { |
|
| 243 | 242 | foreach ($params as $key => $value) { |
| 244 | 243 | $redirectUri = Uri::withQueryValue($redirectUri, $key, $value); |
| 245 | 244 | } |
@@ -166,8 +166,7 @@ |
||
| 166 | 166 | |
| 167 | 167 | try { |
| 168 | 168 | $redirectUri = $grantType->grant($request, $client); |
| 169 | - } |
|
| 170 | - catch(InvalidGrantType $e) { |
|
| 169 | + } catch(InvalidGrantType $e) { |
|
| 171 | 170 | return new ErrorResponse('invalid_grant', $e->getErrorDescription(), $e->getErrorUri()); |
| 172 | 171 | } |
| 173 | 172 | |
@@ -111,8 +111,7 @@ |
||
| 111 | 111 | $token = $responseType->handle($request, $resourceOwner, $client, $scope)['token']; |
| 112 | 112 | $result['token'] = $token; |
| 113 | 113 | $claims['at_hash'] = 'todo'; //todo |
| 114 | - } |
|
| 115 | - else { |
|
| 114 | + } else { |
|
| 116 | 115 | $requestedScopes = isset($data['scope']) ? explode(' ', $data['scope']) : []; |
| 117 | 116 | |
| 118 | 117 | if ((empty($requestedScopes) && !is_null($scope)) || (is_array($scope) && !empty(array_diff($requestedScopes, $scope)))) { |
@@ -121,8 +121,7 @@ |
||
| 121 | 121 | * specified in the Authorization Request using the application/x-www-form-urlencoded format, |
| 122 | 122 | * unless a different Response Mode was specified. |
| 123 | 123 | */ |
| 124 | - } |
|
| 125 | - catch (OAuthException $e) { |
|
| 124 | + } catch (OAuthException $e) { |
|
| 126 | 125 | /** |
| 127 | 126 | * If the Authorization Server encounters any error, it MUST return an error response, per Section 3.1.2.6. |
| 128 | 127 | */ |
@@ -87,11 +87,9 @@ discard block |
||
| 87 | 87 | { |
| 88 | 88 | if($request->getMethod() === 'GET') { |
| 89 | 89 | $requestData = $request->getQueryParams(); |
| 90 | - } |
|
| 91 | - else if($request->getMethod() === 'POST') { |
|
| 90 | + } else if($request->getMethod() === 'POST') { |
|
| 92 | 91 | $requestData = $request->getParsedBody(); |
| 93 | - } |
|
| 94 | - else { |
|
| 92 | + } else { |
|
| 95 | 93 | return new Response(404); |
| 96 | 94 | } |
| 97 | 95 | |
@@ -215,12 +213,10 @@ discard block |
||
| 215 | 213 | throw new OAuthException('invalid_request', 'The request includes the invalid parameter redirect_uri.', |
| 216 | 214 | 'https://tools.ietf.org/html/rfc6749#section-4.1'); |
| 217 | 215 | } |
| 218 | - } |
|
| 219 | - else { |
|
| 216 | + } else { |
|
| 220 | 217 | if (count($redirectUris) == 1) { |
| 221 | 218 | $redirectUri = $redirectUris[0]; |
| 222 | - } |
|
| 223 | - else { |
|
| 219 | + } else { |
|
| 224 | 220 | throw new OAuthException('invalid_request', 'The request is missing the required parameter redirect_uri.', |
| 225 | 221 | 'https://tools.ietf.org/html/rfc6749#section-4.1'); |
| 226 | 222 | } |
@@ -231,8 +227,7 @@ discard block |
||
| 231 | 227 | throw new \InvalidArgumentException('The endpoint URI must not include a fragment component.'); |
| 232 | 228 | } |
| 233 | 229 | $this->redirectUri = $redirectUri; |
| 234 | - } |
|
| 235 | - catch (\InvalidArgumentException $e) { |
|
| 230 | + } catch (\InvalidArgumentException $e) { |
|
| 236 | 231 | throw new OAuthException('invalid_request', 'The request includes the malformed parameter redirect_uri. '.$e->getMessage(), |
| 237 | 232 | 'https://tools.ietf.org/html/rfc6749#section-4.1'); |
| 238 | 233 | } |