Passed
Push — master ( 375bf7...575c01 )
by Luiz Kim
12:20 queued 09:59
created
src/Security/TokenAuthenticator.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@
 block discarded – undo
37 37
 
38 38
 
39 39
         return new Passport(
40
-            new UserBadge($apiToken, function ($apiToken) {
40
+            new UserBadge($apiToken, function($apiToken) {
41 41
                 $user = $this->em->getRepository(User::class)->findOneBy(['apiKey' => $apiToken]);
42 42
                 if (null === $user)
43 43
                     throw new CustomUserMessageAuthenticationException('Invalid API token');
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,15 +32,17 @@
 block discarded – undo
32 32
     public function authenticate(Request $request): Passport
33 33
     {
34 34
         $apiToken = $this->getKey($request);
35
-        if (null === $apiToken)
36
-            throw new CustomUserMessageAuthenticationException('No API token provided');
35
+        if (null === $apiToken) {
36
+                    throw new CustomUserMessageAuthenticationException('No API token provided');
37
+        }
37 38
 
38 39
 
39 40
         return new Passport(
40 41
             new UserBadge($apiToken, function ($apiToken) {
41 42
                 $user = $this->em->getRepository(User::class)->findOneBy(['apiKey' => $apiToken]);
42
-                if (null === $user)
43
-                    throw new CustomUserMessageAuthenticationException('Invalid API token');
43
+                if (null === $user) {
44
+                                    throw new CustomUserMessageAuthenticationException('Invalid API token');
45
+                }
44 46
 
45 47
                 return $user;
46 48
             }),
Please login to merge, or discard this patch.