@@ -118,7 +118,7 @@ |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
121 | - * @param $roomId |
|
121 | + * @param string $roomId |
|
122 | 122 | * @return Carbon |
123 | 123 | */ |
124 | 124 | public function getLastKarmaTimeForRoom($roomId) |
@@ -2,7 +2,6 @@ |
||
2 | 2 | namespace App\Gitter\Middlewares; |
3 | 3 | |
4 | 4 | use App\Gitter\Response; |
5 | -use App\Room; |
|
6 | 5 | use App\Message; |
7 | 6 | use App\Gitter\MiddlewareInterface; |
8 | 7 | use BigShark\SQLToBuilder\BuilderClass; |
@@ -12,7 +12,6 @@ |
||
12 | 12 | |
13 | 13 | |
14 | 14 | use App\Gitter\Extensions\Middlewares\MessageBus; |
15 | -use App\Support\Lazy\EloquentReader; |
|
16 | 15 | use App\User; |
17 | 16 | use App\Room; |
18 | 17 | use App\Message; |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | $client = $this->createClient($container, $config->get('gitter.token')); |
61 | 61 | |
62 | 62 | |
63 | - $this->auth($client, function (User $user) use ($client) { |
|
64 | - $this->findRoom($client, $this->argument('room'), function (GitterRoom $room) use ($client) { |
|
63 | + $this->auth($client, function(User $user) use ($client) { |
|
64 | + $this->findRoom($client, $this->argument('room'), function(GitterRoom $room) use ($client) { |
|
65 | 65 | $this->listen($room, true); |
66 | 66 | }); |
67 | 67 | }); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | protected function auth(Client $client, \Closure $callback) |
80 | 80 | { |
81 | 81 | GitterUser::current($client) |
82 | - ->then(function (GitterUser $gitterUser) use ($callback) { |
|
82 | + ->then(function(GitterUser $gitterUser) use ($callback) { |
|
83 | 83 | $user = User::make($gitterUser); |
84 | 84 | \Auth::setUser($user); |
85 | 85 | |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | protected function listen(GitterRoom $gitter, $startup = false) |
96 | 96 | { |
97 | 97 | /** @var Room $room */ |
98 | - $room = Room::make($gitter, function (Room $room) { |
|
98 | + $room = Room::make($gitter, function(Room $room) { |
|
99 | 99 | $this->call('gitter:sync', [ |
100 | 100 | 'room' => $room->gitter_id, |
101 | 101 | '--users' => true, |
@@ -121,11 +121,11 @@ discard block |
||
121 | 121 | Carbon::now()->toDateTimeString() |
122 | 122 | )); |
123 | 123 | |
124 | - $gitter->onMessage(function (GitterMessage $msg) { |
|
124 | + $gitter->onMessage(function(GitterMessage $msg) { |
|
125 | 125 | app(Client::class)->setFallbackMode(false); |
126 | 126 | $this->onMessage($msg); |
127 | 127 | |
128 | - }, function (\Throwable $e) use ($loop, $gitter) { |
|
128 | + }, function(\Throwable $e) use ($loop, $gitter) { |
|
129 | 129 | $this->warn('Stream not available. Use message fallback fetch mode.'); |
130 | 130 | |
131 | 131 | app(Client::class)->setFallbackMode(true); |
@@ -148,14 +148,14 @@ discard block |
||
148 | 148 | ->first(); |
149 | 149 | |
150 | 150 | if ($lastMessage) { |
151 | - $loop->addTimer($timeout, function () use ($gitter, $lastMessage) { |
|
151 | + $loop->addTimer($timeout, function() use ($gitter, $lastMessage) { |
|
152 | 152 | $gitter |
153 | 153 | ->getMessages($lastMessage->gitter_id, GitterRoom::MESSAGE_FETCH_ASC) |
154 | - ->fetch(function (GitterMessage $message, Controls $controls) { |
|
154 | + ->fetch(function(GitterMessage $message, Controls $controls) { |
|
155 | 155 | $this->onMessage($message); |
156 | 156 | $controls->next(); |
157 | 157 | }) |
158 | - ->then(function () use ($gitter) { |
|
158 | + ->then(function() use ($gitter) { |
|
159 | 159 | $this->warn('Connection...'); |
160 | 160 | $this->listen($gitter); |
161 | 161 | }); |
@@ -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 28.01.2016 16:27 |
|
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 28.01.2016 16:27 |
|
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\Exceptions; |
12 | 12 | |
13 | 13 | use Gitter\Handlers\DebugErrorHandler; |
@@ -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 28.01.2016 16:35 |
|
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 28.01.2016 16:35 |
|
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; |
12 | 12 | |
13 | 13 | use Gitter\Client as BaseClient; |