@@ -1,13 +1,13 @@ |
||
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:09 |
|
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:09 |
|
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\Gitter\Achieve; |
12 | 12 | |
13 | 13 | use App\User; |
@@ -1,13 +1,13 @@ |
||
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:08 |
|
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:08 |
|
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\Gitter\Achieve; |
12 | 12 | |
13 | 13 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | $this->headers['Connection'] = 'Keep-Alive'; |
87 | 87 | |
88 | - $this->buffer->subscribe(function ($message) { |
|
88 | + $this->buffer->subscribe(function($message) { |
|
89 | 89 | $message = trim($message); |
90 | 90 | |
91 | 91 | if ($message) { |
@@ -117,20 +117,20 @@ discard block |
||
117 | 117 | ->getHttpClient() |
118 | 118 | ->request($this->method, $this->url, $this->headers); |
119 | 119 | |
120 | - $request->on('response', function (Response $response) { |
|
121 | - $response->on('data', function ($data, Response $response) { |
|
120 | + $request->on('response', function(Response $response) { |
|
121 | + $response->on('data', function($data, Response $response) { |
|
122 | 122 | $data = (string)$data; |
123 | 123 | $this->events->fire(static::EVENT_CHUNK, [$this, $data, $response]); |
124 | 124 | $this->buffer->add($data); |
125 | 125 | }); |
126 | 126 | }); |
127 | 127 | |
128 | - $request->on('end', function () { |
|
128 | + $request->on('end', function() { |
|
129 | 129 | $this->buffer->clear(); |
130 | 130 | $this->events->fire(static::EVENT_END, [$this]); |
131 | 131 | }); |
132 | 132 | |
133 | - $request->on('error', function ($exception) { |
|
133 | + $request->on('error', function($exception) { |
|
134 | 134 | $this->events->fire(static::EVENT_ERROR, [$this, $exception]); |
135 | 135 | }); |
136 | 136 |
@@ -1,13 +1,13 @@ |
||
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:56 |
|
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:56 |
|
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 | |
12 | 12 | namespace App\Mappers; |
13 | 13 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | |
41 | 41 | $user = static::where('gitter_id', $values['gitter_id'])->first(); |
42 | 42 | if (!$user) { |
43 | - $user = static::unguarded(function () use ($values) { |
|
43 | + $user = static::unguarded(function() use ($values) { |
|
44 | 44 | return static::create($values); |
45 | 45 | }); |
46 | 46 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | public function map(Router $router) |
39 | 39 | { |
40 | - $router->group(['namespace' => $this->namespace], function ($router) { |
|
40 | + $router->group(['namespace' => $this->namespace], function($router) { |
|
41 | 41 | require app_path('Http/routes.php'); |
42 | 42 | }); |
43 | 43 | } |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This file is part of GitterBot package. |
|
4 | - * |
|
5 | - * @author Serafim <[email protected]> |
|
6 | - * @date 11.10.2015 06:03 |
|
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 06:03 |
|
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; |
@@ -69,7 +69,7 @@ |
||
69 | 69 | { |
70 | 70 | parent::boot(); |
71 | 71 | |
72 | - static::creating(function (Achieve $achieve) { |
|
72 | + static::creating(function(Achieve $achieve) { |
|
73 | 73 | if (!$achieve->created_at) { |
74 | 74 | $achieve->created_at = $achieve->freshTimestamp(); |
75 | 75 | } |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * This file is part of GitterBot package. |
|
4 | - * |
|
5 | - * @author Serafim <[email protected]> |
|
6 | - * @date 11.10.2015 22:50 |
|
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 22:50 |
|
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\Console\Commands; |
12 | 12 | |
13 | 13 |
@@ -76,7 +76,7 @@ |
||
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 |
@@ -83,8 +83,8 @@ discard block |
||
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 = 1000; // Per page |
89 | 89 | |
90 | 90 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | return str_replace('.json', '', $file->getFilename()); |
130 | 130 | }; |
131 | 131 | |
132 | - return $parse($b) <=> $parse($a); |
|
132 | + return $parse($b) <= > $parse($a); |
|
133 | 133 | }); |
134 | 134 | |
135 | 135 | |
@@ -156,7 +156,7 @@ discard block |
||
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, |