Passed
Pull Request — master (#14)
by ARCANEDEV
04:40
created
src/Fortify/Auth/ResetsPasswords.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -81,8 +81,9 @@
 block discarded – undo
81 81
     {
82 82
         $status = trans($status);
83 83
 
84
-        if ($request->wantsJson())
85
-            return new JsonResponse(['message' => $status], JsonResponse::HTTP_OK);
84
+        if ($request->wantsJson()) {
85
+                    return new JsonResponse(['message' => $status], JsonResponse::HTTP_OK);
86
+        }
86 87
 
87 88
         return redirect()
88 89
             ->to($this->getRedirectUrl())
Please login to merge, or discard this patch.
src/Fortify/Actions/Authentication/Login/RedirectIfTwoFactorWasEnabled.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -92,8 +92,9 @@  discard block
 block discarded – undo
92 92
      */
93 93
     protected function shouldUseTwoFactor($user): bool
94 94
     {
95
-        if ( ! Auth::isTwoFactorEnabled())
96
-            return false;
95
+        if ( ! Auth::isTwoFactorEnabled()) {
96
+                    return false;
97
+        }
97 98
 
98 99
         return optional($user)->isTwoFactorEnabled()
99 100
             && in_array(HasTwoFactorAuthentication::class, class_uses_recursive($user));
@@ -134,8 +135,9 @@  discard block
 block discarded – undo
134 135
             'login.remember' => $request->filled('remember')
135 136
         ]);
136 137
 
137
-        if ($request->wantsJson())
138
-            return new JsonResponse(['two_factor' => true]);
138
+        if ($request->wantsJson()) {
139
+                    return new JsonResponse(['two_factor' => true]);
140
+        }
139 141
 
140 142
         return redirect()->to($this->getTwoFactorUrl($request));
141 143
     }
Please login to merge, or discard this patch.
src/Fortify/Repositories/TwoFactorAuthenticationRepository.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -67,8 +67,9 @@  discard block
 block discarded – undo
67 67
         $saved = $twoFactor->save();
68 68
         event(new EnabledTwoFactor($user));
69 69
 
70
-        if ($saved)
71
-            $user->refresh();
70
+        if ($saved) {
71
+                    $user->refresh();
72
+        }
72 73
 
73 74
         return $saved;
74 75
     }
@@ -88,8 +89,9 @@  discard block
 block discarded – undo
88 89
         $deleted = $twoFactor->delete();
89 90
         event(new EnablingTwoFactor($user));
90 91
 
91
-        if ($deleted)
92
-            $user->refresh();
92
+        if ($deleted) {
93
+                    $user->refresh();
94
+        }
93 95
 
94 96
         return $deleted;
95 97
     }
Please login to merge, or discard this patch.
src/Fortify/Http/Requests/TwoFactorLoginRequest.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -81,8 +81,9 @@  discard block
 block discarded – undo
81 81
      */
82 82
     public function hasValidCode(): bool
83 83
     {
84
-        if (is_null($this->code))
85
-            return false;
84
+        if (is_null($this->code)) {
85
+                    return false;
86
+        }
86 87
 
87 88
         $secret = $this->twoFactor()->decrypted_secret;
88 89
 
@@ -110,16 +111,19 @@  discard block
 block discarded – undo
110 111
      */
111 112
     public function challengedUser(): ?HasTwoFactor
112 113
     {
113
-        if ($this->challengedUser)
114
-            return $this->challengedUser;
114
+        if ($this->challengedUser) {
115
+                    return $this->challengedUser;
116
+        }
115 117
 
116 118
         $model = $this->guard()->getProvider()->getModel();
117 119
 
118
-        if ( ! $this->session()->has('login.id'))
119
-            return null;
120
+        if ( ! $this->session()->has('login.id')) {
121
+                    return null;
122
+        }
120 123
 
121
-        if ( ! $user = $model::find($this->session()->pull('login.id')))
122
-            return null;
124
+        if ( ! $user = $model::find($this->session()->pull('login.id'))) {
125
+                    return null;
126
+        }
123 127
 
124 128
         return $this->challengedUser = $user;
125 129
     }
Please login to merge, or discard this patch.
src/Fortify/Auth/ConfirmsPasswords.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,8 +39,9 @@
 block discarded – undo
39 39
     {
40 40
         $confirmed = $this->confirmCredentials($request);
41 41
 
42
-        if ( ! $confirmed)
43
-            return $this->getFailedResponse($request);
42
+        if ( ! $confirmed) {
43
+                    return $this->getFailedResponse($request);
44
+        }
44 45
 
45 46
         $request->session()->put($this->sessionKey(), time());
46 47
 
Please login to merge, or discard this patch.