Completed
Push — development ( 7f868f...6153ea )
by Claudio
12s
created
app/Models/Article.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -98,8 +98,9 @@
 block discarded – undo
98 98
     {
99 99
         $categories = [];
100 100
 
101
-        foreach (explode(',', $this->attributes['categories']) as $articleCategory)
102
-            $categories[] = ArticleCategory::query()->where('link', $articleCategory)->first();
101
+        foreach (explode(',', $this->attributes['categories']) as $articleCategory) {
102
+                    $categories[] = ArticleCategory::query()->where('link', $articleCategory)->first();
103
+        }
103 104
 
104 105
         return $categories;
105 106
     }
Please login to merge, or discard this patch.
app/Models/ShopInventory.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -67,8 +67,9 @@
 block discarded – undo
67 67
     {
68 68
         $paymentMethods = [];
69 69
 
70
-        foreach (PaymentCategory::where('country_code', $countryCode)->get(['payment_type']) as $paymentMethod)
71
-            $paymentMethods[] = $paymentMethod->payment_type;
70
+        foreach (PaymentCategory::where('country_code', $countryCode)->get(['payment_type']) as $paymentMethod) {
71
+                    $paymentMethods[] = $paymentMethod->payment_type;
72
+        }
72 73
 
73 74
         $this->paymentCategories = $paymentMethods;
74 75
     }
Please login to merge, or discard this patch.
app/Http/Controllers/PublicPhotosController.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,8 +54,9 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function likePhoto(Request $request, $photoId): JsonResponse
56 56
     {
57
-        if (PhotoLike::where('username', $request->user()->name)->where('photo_id', $photoId)->count() > 0)
58
-            return response()->json('');
57
+        if (PhotoLike::where('username', $request->user()->name)->where('photo_id', $photoId)->count() > 0) {
58
+                    return response()->json('');
59
+        }
59 60
 
60 61
         (new PhotoLike)->store($photoId, $request->user()->name)->save();
61 62
 
@@ -71,8 +72,9 @@  discard block
 block discarded – undo
71 72
      */
72 73
     public function unlikePhoto(Request $request, $photoId): JsonResponse
73 74
     {
74
-        if (PhotoLike::where('username', $request->user()->name)->where('photo_id', $photoId)->count() == 0)
75
-            return response()->json('');
75
+        if (PhotoLike::where('username', $request->user()->name)->where('photo_id', $photoId)->count() == 0) {
76
+                    return response()->json('');
77
+        }
76 78
 
77 79
         PhotoLike::where('username', $request->user()->name)->where('photo_id', $photoId)->delete();
78 80
 
Please login to merge, or discard this patch.
app/Exceptions/Handler.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,9 @@
 block discarded – undo
50 50
      */
51 51
     public function render($request, Exception $e)
52 52
     {
53
-        if ($e instanceof NotFoundHttpException)
54
-            return response(view('habbo-web'));
53
+        if ($e instanceof NotFoundHttpException) {
54
+                    return response(view('habbo-web'));
55
+        }
55 56
 
56 57
         return parent::render($request, $e);
57 58
     }
Please login to merge, or discard this patch.
app/Models/UserProfile.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,8 +94,9 @@
 block discarded – undo
94 94
     {
95 95
         $groups = GroupMember::where('user_id', $this->user->uniqueId)->get() ?? [];
96 96
 
97
-        foreach ($groups as $group)
98
-            $this->groups[] = $group->guild;
97
+        foreach ($groups as $group) {
98
+                    $this->groups[] = $group->guild;
99
+        }
99 100
     }
100 101
 
101 102
     /**
Please login to merge, or discard this patch.
app/Http/Controllers/AccountSecurityController.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -183,7 +183,7 @@
 block discarded – undo
183 183
      * Confirm User Change Password
184 184
      *
185 185
      * @param Request $request
186
-     * @return mixed
186
+     * @return JsonResponse
187 187
      */
188 188
     public function confirmChangePassword(Request $request): JsonResponse
189 189
     {
Please login to merge, or discard this patch.
Braces   +30 added lines, -20 removed lines patch added patch discarded remove patch
@@ -28,8 +28,9 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function featureStatus(Request $request): Response
30 30
     {
31
-        if ($request->user()->emailVerified == false)
32
-            return response('identity_verification_required', 200);
31
+        if ($request->user()->emailVerified == false) {
32
+                    return response('identity_verification_required', 200);
33
+        }
33 34
 
34 35
         $featureEnabled = UserSecurity::find($request->user()->uniqueId);
35 36
 
@@ -44,8 +45,9 @@  discard block
 block discarded – undo
44 45
      */
45 46
     public function saveQuestions(Request $request): JsonResponse
46 47
     {
47
-        if (User::where('password', hash(Config::get('chocolatey.security.hash'), $request->json()->get('password')))->count() == 0)
48
-            return response()->json(['error' => 'invalid_password'], 400);
48
+        if (User::where('password', hash(Config::get('chocolatey.security.hash'), $request->json()->get('password')))->count() == 0) {
49
+                    return response()->json(['error' => 'invalid_password'], 400);
50
+        }
49 51
 
50 52
         UserSecurity::updateOrCreate([
51 53
             'user_id' => $request->user()->uniqueId,
@@ -93,12 +95,14 @@  discard block
 block discarded – undo
93 95
      */
94 96
     public function changePassword(Request $request): JsonResponse
95 97
     {
96
-        if (strlen($request->json()->get('password')) < 6)
97
-            return response()->json(['error' => 'password.current_password.invalid'], 409);
98
+        if (strlen($request->json()->get('password')) < 6) {
99
+                    return response()->json(['error' => 'password.current_password.invalid'], 409);
100
+        }
98 101
 
99 102
         //@TODO: This search the whole base. If anyone has the same password.. This will give error. Is this good?
100
-        if (User::where('password', hash(Config::get('chocolatey.security.hash'), $request->json()->get('currentPassword')))->count() >= 1)
101
-            return response()->json(['error' => 'password.used_earlier'], 409);
103
+        if (User::where('password', hash(Config::get('chocolatey.security.hash'), $request->json()->get('currentPassword')))->count() >= 1) {
104
+                    return response()->json(['error' => 'password.used_earlier'], 409);
105
+        }
102 106
 
103 107
         User::find($request->user()->uniqueId)->update(['password' =>
104 108
             hash(Config::get('chocolatey.security.hash'), $request->json()->get('password'))]);
@@ -114,11 +118,13 @@  discard block
 block discarded – undo
114 118
      */
115 119
     public function changeMail(Request $request): JsonResponse
116 120
     {
117
-        if (User::where('password', hash(Config::get('chocolatey.security.hash'), $request->json()->get('currentPassword')))->count() == 0)
118
-            return response()->json(['error' => 'changeEmail.invalid_password'], 400);
121
+        if (User::where('password', hash(Config::get('chocolatey.security.hash'), $request->json()->get('currentPassword')))->count() == 0) {
122
+                    return response()->json(['error' => 'changeEmail.invalid_password'], 400);
123
+        }
119 124
 
120
-        if (ChocolateyId::where('mail', $request->json()->get('newEmail'))->count() > 0)
121
-            return response()->json(['error' => 'changeEmail.email_already_in_use'], 400);
125
+        if (ChocolateyId::where('mail', $request->json()->get('newEmail'))->count() > 0) {
126
+                    return response()->json(['error' => 'changeEmail.email_already_in_use'], 400);
127
+        }
122 128
 
123 129
         $this->sendChangeMailConfirmation($request);
124 130
 
@@ -159,8 +165,9 @@  discard block
 block discarded – undo
159 165
      */
160 166
     public function getQuestions(Request $request): JsonResponse
161 167
     {
162
-        if (UserSecurity::find($request->user()->uniqueId) == null)
163
-            return response()->json('');
168
+        if (UserSecurity::find($request->user()->uniqueId) == null) {
169
+                    return response()->json('');
170
+        }
164 171
 
165 172
         $userSecurity = UserSecurity::find($request->user()->uniqueId);
166 173
 
@@ -184,8 +191,9 @@  discard block
 block discarded – undo
184 191
                 ->where('firstAnswer', $request->json()->get('answer1'))
185 192
                 ->where('secondAnswer', $request->json()->get('answer2'))->count() > 0
186 193
         ):
187
-            if ($request->json()->get('trust') == true)
188
-                (new TrustedDevice)->store($request->user()->uniqueId, $request->ip())->save();
194
+            if ($request->json()->get('trust') == true) {
195
+                            (new TrustedDevice)->store($request->user()->uniqueId, $request->ip())->save();
196
+            }
189 197
 
190 198
             return response()->json(null, 204);
191 199
         endif;
@@ -201,11 +209,13 @@  discard block
 block discarded – undo
201 209
      */
202 210
     public function confirmChangePassword(Request $request): JsonResponse
203 211
     {
204
-        if (($mail = (new MailController)->getMail($request->json()->get('token'))) == null)
205
-            return response()->json(null, 404);
212
+        if (($mail = (new MailController)->getMail($request->json()->get('token'))) == null) {
213
+                    return response()->json(null, 404);
214
+        }
206 215
 
207
-        if (User::where('password', hash(Config::get('chocolatey.security.hash'), $request->json()->get('password')))->count() >= 1)
208
-            return response()->json(['error' => 'password.used_earlier'], 400);
216
+        if (User::where('password', hash(Config::get('chocolatey.security.hash'), $request->json()->get('password')))->count() >= 1) {
217
+                    return response()->json(['error' => 'password.used_earlier'], 400);
218
+        }
209 219
 
210 220
         $mail->update(['used' => '1']);
211 221
 
Please login to merge, or discard this patch.
app/Providers/AppServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     public function register()
15 15
     {
16 16
         // Register Mailing Services
17
-        $this->app->singleton('mailer', function ($app) {
17
+        $this->app->singleton('mailer', function($app) {
18 18
             return $app->loadComponent('mail', 'Illuminate\Mail\MailServiceProvider', 'mailer');
19 19
         });
20 20
     }
Please login to merge, or discard this patch.
app/Http/Controllers/ShopController.php 2 patches
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -99,8 +99,9 @@
 block discarded – undo
99 99
     {
100 100
         $voucher = DB::table('vouchers')->where('code', $request->json()->get('voucherCode'))->first();
101 101
 
102
-        if ($voucher == null)
103
-            return response()->json(null, 404);
102
+        if ($voucher == null) {
103
+                    return response()->json(null, 404);
104
+        }
104 105
 
105 106
         DB::table('users')->where('id', $request->user()->uniqueId)->increment('credits', $voucher->credits);
106 107
         DB::table('users')->where('id', $request->user()->uniqueId)->increment('pixels', $voucher->points);
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@
 block discarded – undo
148 148
      * @TODO: Ability of custom this shit
149 149
      *
150 150
      * @param Request $request
151
-     * @return mixed
151
+     * @return JsonResponse
152 152
      */
153 153
     public function getWall(Request $request): JsonResponse
154 154
     {
Please login to merge, or discard this patch.
app/Models/UserSecurity.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
     public function getTrustedDevicesAttribute(): array
69 69
     {
70 70
         return TrustedDevice::where('user_id', $this->attributes['user_id'])->get(['ip_address'])
71
-            ->map(function ($item) {
71
+            ->map(function($item) {
72 72
                 return $item->ip_address;
73 73
             })->toArray();
74 74
     }
Please login to merge, or discard this patch.