Completed
Push — development ( d0c7a3...42dd30 )
by Claudio
02:25
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/ShopController.php 1 patch
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.
app/Http/Controllers/ProfileController.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -27,8 +27,9 @@  discard block
 block discarded – undo
27 27
     {
28 28
         $userData = User::where('username', $request->input('name'))->first();
29 29
 
30
-        if ($userData == null)
31
-            return response()->json(null, 404);
30
+        if ($userData == null) {
31
+                    return response()->json(null, 404);
32
+        }
32 33
 
33 34
         $userPreferences = UserPreferences::find($userData->uniqueId);
34 35
 
@@ -48,13 +49,15 @@  discard block
 block discarded – undo
48 49
     {
49 50
         $userData = User::find($userId);
50 51
 
51
-        if ($userData == null)
52
-            return response()->json(null, 404);
52
+        if ($userData == null) {
53
+                    return response()->json(null, 404);
54
+        }
53 55
 
54 56
         $userPreferences = UserPreferences::find($userData->uniqueId);
55 57
 
56
-        if ($userPreferences != null && $userPreferences->profileVisible == '0')
57
-            return response()->json(null, 404);
58
+        if ($userPreferences != null && $userPreferences->profileVisible == '0') {
59
+                    return response()->json(null, 404);
60
+        }
58 61
 
59 62
         return response()->json(new UserProfile($userData));
60 63
     }
@@ -90,8 +93,9 @@  discard block
 block discarded – undo
90 93
      */
91 94
     public function getPhotos(int $userId): JsonResponse
92 95
     {
93
-        if (Photo::where('creator_id', $userId)->count() == 0)
94
-            return response()->json([]);
96
+        if (Photo::where('creator_id', $userId)->count() == 0) {
97
+                    return response()->json([]);
98
+        }
95 99
 
96 100
         $userPhotos = Photo::where('creator_id', $userId)->get();
97 101
 
Please login to merge, or discard this patch.
app/Http/Controllers/RoomsController.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,9 @@
 block discarded – undo
28 28
     {
29 29
         $leaderRank = 1;
30 30
 
31
-        foreach (($leaderBoard = Room::orderBy('score', 'DESC')->orderBy('users', 'DESC')->limit(50)->get()) as $room)
32
-            $room->leaderboardRank = $leaderRank++;
31
+        foreach (($leaderBoard = Room::orderBy('score', 'DESC')->orderBy('users', 'DESC')->limit(50)->get()) as $room) {
32
+                    $room->leaderboardRank = $leaderRank++;
33
+        }
33 34
 
34 35
         return response()->json($leaderBoard, 200, array(), JSON_UNESCAPED_SLASHES);
35 36
     }
Please login to merge, or discard this patch.
app/Http/Controllers/ArticleController.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -61,8 +61,9 @@  discard block
 block discarded – undo
61 61
                 return $category->name == 'all' || in_array($category, $item->categories);
62 62
             });
63 63
 
64
-        if ($articles->count() == 0)
65
-            return response()->json(null, 404);
64
+        if ($articles->count() == 0) {
65
+                    return response()->json(null, 404);
66
+        }
66 67
 
67 68
         return response(view('habbo-web-news.articles-category', [
68 69
             'category' => $category,
@@ -83,8 +84,9 @@  discard block
 block discarded – undo
83 84
      */
84 85
     public function one(string $countryId, string $articleName): Response
85 86
     {
86
-        if (($article = Article::find(strstr($articleName, '_', true))) == null)
87
-            return response()->json(null, 404);
87
+        if (($article = Article::find(strstr($articleName, '_', true))) == null) {
88
+                    return response()->json(null, 404);
89
+        }
88 90
 
89 91
         $related = ($latest = Article::all())->filter(function ($item) use ($article) {
90 92
             return in_array($article->categories[0], $item->categories);
Please login to merge, or discard this patch.