Completed
Branch master (542498)
by Kirill
10:42
created
app/Http/Controllers/Api/UsersController.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public function index()
28 28
     {
29
-        return \Cache::remember('users', 1, function () {
29
+        return \Cache::remember('users', 1, function() {
30 30
             $karmaStorage = [];
31 31
             $thanksStorage = [];
32 32
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
                 ->selectRaw('user_target_id, count(user_id) as count')
35 35
                 ->groupBy('user_target_id')
36 36
                 ->get()
37
-                ->each(function ($item) use (&$karmaStorage) {
37
+                ->each(function($item) use (&$karmaStorage) {
38 38
                     $karmaStorage[$item->user_target_id] = $item->count;
39 39
                 });
40 40
 
@@ -42,16 +42,16 @@  discard block
 block discarded – undo
42 42
                 ->selectRaw('user_id, count(user_target_id) as count')
43 43
                 ->groupBy('user_id')
44 44
                 ->get()
45
-                ->each(function ($item) use (&$thanksStorage) {
45
+                ->each(function($item) use (&$thanksStorage) {
46 46
                     $thanksStorage[$item->user_id] = $item->count;
47 47
                 });
48 48
 
49 49
 
50 50
             return (new User())
51 51
                 ->get(['id', 'login', 'name', 'gitter_id', 'avatar', 'url'])
52
-                ->each(function (User $user) use ($karmaStorage, $thanksStorage) {
53
-                    $user->karma_count = $karmaStorage[$user->id] ?? 0;
54
-                    $user->thanks_count = $thanksStorage[$user->id] ?? 0;
52
+                ->each(function(User $user) use ($karmaStorage, $thanksStorage) {
53
+                    $user->karma_count = $karmaStorage[$user->id] ? ? 0;
54
+                    $user->thanks_count = $thanksStorage[$user->id] ? ? 0;
55 55
                 });
56 56
         });
57 57
     }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public function getUsersTop()
63 63
     {
64
-        return \Cache::remember('top.karma', 1, function () {
64
+        return \Cache::remember('top.karma', 1, function() {
65 65
             $karmaStorage = [];
66 66
 
67 67
             $karma = (new Karma())
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                 ->orderBy('count', 'desc')
71 71
                 ->take(10)
72 72
                 ->get()
73
-                ->each(function ($item) use (&$karmaStorage) {
73
+                ->each(function($item) use (&$karmaStorage) {
74 74
                     $karmaStorage[$item->user_target_id] = $item->count;
75 75
                 });
76 76
 
@@ -78,8 +78,8 @@  discard block
 block discarded – undo
78 78
             return (new User())
79 79
                 ->whereIn('id', $karma->pluck('user_target_id'))
80 80
                 ->get(['id', 'login', 'name', 'gitter_id', 'avatar', 'url'])
81
-                ->each(function (User $user) use ($karmaStorage) {
82
-                    $user->karma_count = $karmaStorage[$user->id] ?? 0;
81
+                ->each(function(User $user) use ($karmaStorage) {
82
+                    $user->karma_count = $karmaStorage[$user->id] ? ? 0;
83 83
                 });
84 84
         });
85 85
     }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
      */
90 90
     public function getUser($gitterId)
91 91
     {
92
-        $formatRelations = function (HasMany $query) {
92
+        $formatRelations = function(HasMany $query) {
93 93
             return $query->orderBy('created_at', 'desc');
94 94
         };
95 95
 
Please login to merge, or discard this patch.
app/Http/Controllers/Api/AchievementsController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,21 +27,21 @@
 block discarded – undo
27 27
      */
28 28
     public function index()
29 29
     {
30
-        return \Cache::remember('achievements', 10, function () {
30
+        return \Cache::remember('achievements', 10, function() {
31 31
             $achieveStorage = [];
32 32
 
33 33
             (new Achieve())
34 34
                 ->selectRaw('name, count(user_id) as count')
35 35
                 ->groupBy('name')
36 36
                 ->get()
37
-                ->each(function ($item) use (&$achieveStorage) {
37
+                ->each(function($item) use (&$achieveStorage) {
38 38
                     $achieveStorage[$item->name] = $item->count;
39 39
                 });
40 40
 
41 41
             return (new AchieveSubscriber())
42 42
                 ->toCollection()
43
-                ->each(function (AbstractAchieve $achieve) use ($achieveStorage) {
44
-                    $achieve->users = $achieveStorage[$achieve->name] ?? 0;
43
+                ->each(function(AbstractAchieve $achieve) use ($achieveStorage) {
44
+                    $achieve->users = $achieveStorage[$achieve->name] ? ? 0;
45 45
                 })
46 46
                 ->toArray();
47 47
         });
Please login to merge, or discard this patch.