@@ -27,8 +27,9 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -91,8 +94,9 @@ discard block |
||
| 91 | 94 | */ |
| 92 | 95 | public function getPhotos(Request $request, int $userId): JsonResponse |
| 93 | 96 | { |
| 94 | - if (Photo::where('creator_id', $userId)->count() == 0) |
|
| 95 | - return response()->json([]); |
|
| 97 | + if (Photo::where('creator_id', $userId)->count() == 0) { |
|
| 98 | + return response()->json([]); |
|
| 99 | + } |
|
| 96 | 100 | |
| 97 | 101 | $userPhotos = Photo::where('creator_id', $userId)->get(); |
| 98 | 102 | |
@@ -28,8 +28,9 @@ |
||
| 28 | 28 | { |
| 29 | 29 | $leaderRank = 1; |
| 30 | 30 | |
| 31 | - foreach (($leaderBoard = Room::orderBy('users', 'DESC')->orderBy('score', 'DESC')->limit(50)->get()) as $room) |
|
| 32 | - $room->leaderboardRank = $leaderRank++; |
|
| 31 | + foreach (($leaderBoard = Room::orderBy('users', 'DESC')->orderBy('score', '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 | } |