Passed
Push — master ( a8d522...c97e91 )
by Alexandre
02:40
created
src/OAuth2/Endpoints/AuthorizationEndpoint.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -87,11 +87,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/OAuth2/ClientAuthentication/ClientAuthenticationMethodManager.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,12 +59,13 @@
 block discarded – undo
59 59
                     'https://tools.ietf.org/html/rfc6749#section-3.2.1');
60 60
             }
61 61
 
62
-            if($client->getMetadata()->getTokenEndpointAuthMethod())
63
-        } else { // else check client_id parameter
62
+            if($client->getMetadata()->getTokenEndpointAuthMethod()) {
63
+                    } else { // else check client_id parameter
64 64
             if (empty($requestData['client_id'])) {
65 65
                 throw new OAuthException('invalid_request', 'The request is missing the required parameter client_id.',
66 66
                     'https://tools.ietf.org/html/rfc6749#section-4.1');
67 67
             }
68
+            }
68 69
 
69 70
             if (!$client = $this->clientStorage->get($requestData['client_id'])) {
70 71
                 throw new OAuthException('invalid_request', 'The request includes the invalid parameter client_id.',
Please login to merge, or discard this patch.