Completed
Push — development ( 354089...7dde39 )
by Claudio
05:06
created
app/Models/User.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -235,7 +235,7 @@
 block discarded – undo
235 235
      */
236 236
     public function getTraitsAttribute(): array
237 237
     {
238
-        if($this->attributes['rank'] >= 6)
238
+        if ($this->attributes['rank'] >= 6)
239 239
             return ["STAFF"];
240 240
 
241 241
         return $this->traits;
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -235,8 +235,9 @@  discard block
 block discarded – undo
235 235
      */
236 236
     public function getTraitsAttribute(): array
237 237
     {
238
-        if($this->attributes['rank'] >= 6)
239
-            return ["STAFF"];
238
+        if($this->attributes['rank'] >= 6) {
239
+                    return ["STAFF"];
240
+        }
240 241
 
241 242
         return $this->traits;
242 243
     }
@@ -248,8 +249,9 @@  discard block
 block discarded – undo
248 249
      */
249 250
     public function getTrustedAttribute(): bool
250 251
     {
251
-        if (UserSecurity::find($this->attributes['id']) == null)
252
-            return true;
252
+        if (UserSecurity::find($this->attributes['id']) == null) {
253
+                    return true;
254
+        }
253 255
 
254 256
         return in_array($this->attributes['ip_current'],
255 257
             UserSecurity::find($this->attributes['id'])->trustedDevices);
Please login to merge, or discard this patch.
app/Http/Controllers/LoginController.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
 
69 69
         $userData->update(['last_login' => time()]);
70 70
 
71
-        if(Config::get('chocolatey.vote.enabled'))
71
+        if (Config::get('chocolatey.vote.enabled'))
72 72
             Session::set('VotePolicy', true);
73 73
 
74 74
         return response()->json($userData);
Please login to merge, or discard this patch.
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,10 +24,11 @@  discard block
 block discarded – undo
24 24
     public function login(Request $request): JsonResponse
25 25
     {
26 26
         if ($request->user()):
27
-            if ($request->user()->isBanned)
28
-                return response()->json(['message' => 'login.user_banned',
27
+            if ($request->user()->isBanned) {
28
+                            return response()->json(['message' => 'login.user_banned',
29 29
                     'expiryTime' => $request->user()->banDetails->ban_expire,
30 30
                     'reason' => $request->user()->banDetails->ban_reason], 401);
31
+            }
31 32
 
32 33
             $request->user()->update(['last_login' => time(), 'ip_current' => $request->ip()]);
33 34
 
@@ -58,18 +59,21 @@  discard block
 block discarded – undo
58 59
      */
59 60
     public function register(Request $request): JsonResponse
60 61
     {
61
-        if (strpos($request->json()->get('email'), '@') == false)
62
-            return response()->json(['error' => 'registration_email'], 409);
62
+        if (strpos($request->json()->get('email'), '@') == false) {
63
+                    return response()->json(['error' => 'registration_email'], 409);
64
+        }
63 65
 
64
-        if (ChocolateyId::query()->where('mail', $request->json()->get('email'))->count() > 0)
65
-            return response()->json(['error' => 'registration_email_in_use'], 409);
66
+        if (ChocolateyId::query()->where('mail', $request->json()->get('email'))->count() > 0) {
67
+                    return response()->json(['error' => 'registration_email_in_use'], 409);
68
+        }
66 69
 
67 70
         $userData = (new AccountController)->createUser($request, $request->json()->all(), true);
68 71
 
69 72
         $userData->update(['last_login' => time()]);
70 73
 
71
-        if(Config::get('chocolatey.vote.enabled'))
72
-            Session::set('VotePolicy', true);
74
+        if(Config::get('chocolatey.vote.enabled')) {
75
+                    Session::set('VotePolicy', true);
76
+        }
73 77
 
74 78
         return response()->json($userData);
75 79
     }
Please login to merge, or discard this patch.