Completed
Push — master ( 9464e0...f141df )
by Kirill
02:53
created
app/Console/Commands/StartGitterBot.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
 
77 77
         $this->line(sprintf(' Gitter Bot %s started at %s', Client::VERSION, $started->toDateTimeString()));
78 78
 
79
-        $client->getEventLoop()->addPeriodicTimer(1, function () use ($started) {
79
+        $client->getEventLoop()->addPeriodicTimer(1, function() use ($started) {
80 80
             $memory = number_format(memory_get_usage(true) / 1000 / 1000, 2);
81 81
             $uptime = Carbon::now()->diff($started);
82 82
 
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,6 @@
 block discarded – undo
19 19
 use Illuminate\Console\Command;
20 20
 use Illuminate\Contracts\Config\Repository;
21 21
 use Illuminate\Contracts\Container\Container;
22
-use Illuminate\Support\Facades\Log;
23 22
 
24 23
 
25 24
 /**
Please login to merge, or discard this patch.
app/Message.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * This file is part of GitterBot package.
4
- *
5
- * @author Serafim <[email protected]>
6
- * @date 09.10.2015 16:58
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
3
+     * This file is part of GitterBot package.
4
+     *
5
+     * @author Serafim <[email protected]>
6
+     * @date 09.10.2015 16:58
7
+     *
8
+     * For the full copyright and license information, please view the LICENSE
9
+     * file that was distributed with this source code.
10
+     */
11 11
 namespace App;
12 12
 
13 13
 use Carbon\Carbon;
Please login to merge, or discard this patch.
app/Karma.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * This file is part of GitterBot package.
4
- *
5
- * @author Serafim <[email protected]>
6
- * @date 09.10.2015 20:15
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
3
+     * This file is part of GitterBot package.
4
+     *
5
+     * @author Serafim <[email protected]>
6
+     * @date 09.10.2015 20:15
7
+     *
8
+     * For the full copyright and license information, please view the LICENSE
9
+     * file that was distributed with this source code.
10
+     */
11 11
 namespace App;
12 12
 
13 13
 use Carbon\Carbon;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
     {
59 59
         parent::boot();
60 60
 
61
-        static::creating(function (Karma $karma) {
61
+        static::creating(function(Karma $karma) {
62 62
             if (!$karma->created_at) {
63 63
                 $karma->created_at = $karma->freshTimestamp();
64 64
             }
Please login to merge, or discard this patch.
app/Http/routes.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 Route::get('/achievements', 'HomeController@index');
9 9
 
10 10
 
11
-Route::group(['prefix' => 'api', 'namespace' => 'Api'], function () {
11
+Route::group(['prefix' => 'api', 'namespace' => 'Api'], function() {
12 12
     // Users
13 13
     Route::get('users.json', 'UsersController@index');
14 14
     Route::get('users/top.json', 'UsersController@getUsersTop');
@@ -18,12 +18,12 @@  discard block
 block discarded – undo
18 18
     Route::get('achievements.json', 'AchievementsController@index');
19 19
 
20 20
 
21
-    Route::any('/{any}', function () {
21
+    Route::any('/{any}', function() {
22 22
         return ['error' => 'Not found'];
23 23
     })->where('any', '.*?');
24 24
 });
25 25
 
26 26
 
27
-Route::any('/{any}', function () {
27
+Route::any('/{any}', function() {
28 28
     return Redirect::to('/');
29 29
 })->where('any', '.*?');
30 30
\ No newline at end of file
Please login to merge, or discard this patch.
app/Http/Controllers/Api/AchievementsController.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * This file is part of GitterBot package.
4
- *
5
- * @author Serafim <[email protected]>
6
- * @date 14.10.2015 11:21
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
3
+     * This file is part of GitterBot package.
4
+     *
5
+     * @author Serafim <[email protected]>
6
+     * @date 14.10.2015 11:21
7
+     *
8
+     * For the full copyright and license information, please view the LICENSE
9
+     * file that was distributed with this source code.
10
+     */
11 11
 namespace App\Http\Controllers\Api;
12 12
 
13 13
 use App\Achieve;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,20 +27,20 @@
 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) {
43
+                ->each(function(AbstractAchieve $achieve) use ($achieveStorage) {
44 44
                     $achieve->users = $achieveStorage[$achieve->name] ?? 0;
45 45
                 })
46 46
                 ->toArray();
Please login to merge, or discard this patch.
app/Console/Commands/GitterSync.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,6 @@
 block discarded – undo
12 12
 
13 13
 namespace App\Console\Commands;
14 14
 
15
-use App\Gitter\Console\CircleProgress;
16 15
 use App\Karma;
17 16
 use App\User;
18 17
 use App\Room;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
 
84 84
 
85 85
         $request = $this->cursor($client, $room);
86
-        $count = 1;   // Start number
87
-        $page = 0;   // Current page
86
+        $count = 1; // Start number
87
+        $page = 0; // Current page
88 88
         $chunk = 100; // Per page
89 89
 
90 90
 
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
      */
157 157
     public function cursor(Client $client, Room $room)
158 158
     {
159
-        return function ($limit = 100, $skip = 0) use ($client, $room) {
159
+        return function($limit = 100, $skip = 0) use ($client, $room) {
160 160
             return $client->request('message.list', [
161 161
                 'roomId' => $room->id,
162 162
                 'limit'  => $limit,
Please login to merge, or discard this patch.
app/Http/Controllers/Api/UsersController.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * This file is part of GitterBot package.
4
- *
5
- * @author Serafim <[email protected]>
6
- * @date 14.10.2015 11:21
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
3
+     * This file is part of GitterBot package.
4
+     *
5
+     * @author Serafim <[email protected]>
6
+     * @date 14.10.2015 11:21
7
+     *
8
+     * For the full copyright and license information, please view the LICENSE
9
+     * file that was distributed with this source code.
10
+     */
11 11
 namespace App\Http\Controllers\Api;
12 12
 
13 13
 use App\Achieve;
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 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,14 +42,14 @@  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) {
52
+                ->each(function(User $user) use ($karmaStorage, $thanksStorage) {
53 53
                     $user->karma_count = $karmaStorage[$user->id] ?? 0;
54 54
                     $user->thanks_count = $thanksStorage[$user->id] ?? 0;
55 55
                 });
@@ -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,7 +78,7 @@  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) {
81
+                ->each(function(User $user) use ($karmaStorage) {
82 82
                     $user->karma_count = $karmaStorage[$user->id] ?? 0;
83 83
                 });
84 84
         });
@@ -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/Subscribers/Achievements/Thanks100Achieve.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * This file is part of GitterBot package.
4
- *
5
- * @author Serafim <[email protected]>
6
- * @date 11.10.2015 6:07
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
3
+     * This file is part of GitterBot package.
4
+     *
5
+     * @author Serafim <[email protected]>
6
+     * @date 11.10.2015 6:07
7
+     *
8
+     * For the full copyright and license information, please view the LICENSE
9
+     * file that was distributed with this source code.
10
+     */
11 11
 namespace App\Subscribers\Achievements;
12 12
 
13 13
 use App\Karma;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
      */
40 40
     public function handle()
41 41
     {
42
-        Karma::created(function (Karma $karma) {
42
+        Karma::created(function(Karma $karma) {
43 43
 
44 44
             $count = $karma->target->karma->count();
45 45
 
Please login to merge, or discard this patch.
app/Subscribers/Achievements/Karma500Achieve.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * This file is part of GitterBot package.
4
- *
5
- * @author Serafim <[email protected]>
6
- * @date 11.10.2015 6:07
7
- *
8
- * For the full copyright and license information, please view the LICENSE
9
- * file that was distributed with this source code.
10
- */
3
+     * This file is part of GitterBot package.
4
+     *
5
+     * @author Serafim <[email protected]>
6
+     * @date 11.10.2015 6:07
7
+     *
8
+     * For the full copyright and license information, please view the LICENSE
9
+     * file that was distributed with this source code.
10
+     */
11 11
 namespace App\Subscribers\Achievements;
12 12
 
13 13
 use App\Karma;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
      */
40 40
     public function handle()
41 41
     {
42
-        Karma::created(function (Karma $karma) {
42
+        Karma::created(function(Karma $karma) {
43 43
 
44 44
             $count = $karma->target->karma->count();
45 45
 
Please login to merge, or discard this patch.