@@ -15,7 +15,6 @@ |
||
| 15 | 15 | use App\Message; |
| 16 | 16 | use Carbon\Carbon; |
| 17 | 17 | use App\Gitter\Support\AttributeMapper; |
| 18 | -use Illuminate\Database\Eloquent\Model; |
|
| 19 | 18 | |
| 20 | 19 | /** |
| 21 | 20 | * Class MessageMapperTrait |
@@ -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:59 |
|
| 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:59 |
|
| 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\Mappers; |
| 12 | 12 | |
| 13 | 13 | use App\Room; |
@@ -36,19 +36,19 @@ discard block |
||
| 36 | 36 | $values = (new AttributeMapper($attributes)) |
| 37 | 37 | ->rename('readBy', 'read_by') |
| 38 | 38 | ->rename('id', 'gitter_id') |
| 39 | - ->value('editedAt', function ($val) { |
|
| 39 | + ->value('editedAt', function($val) { |
|
| 40 | 40 | return !!$val; |
| 41 | 41 | }, 'edited') |
| 42 | - ->value('fromUser', function ($user) { |
|
| 42 | + ->value('fromUser', function($user) { |
|
| 43 | 43 | return User::fromGitterObject($user); |
| 44 | 44 | }, 'user') |
| 45 | - ->value('sent', function ($date) { |
|
| 45 | + ->value('sent', function($date) { |
|
| 46 | 46 | return (new Carbon($date))->setTimezone('Europe/Moscow'); |
| 47 | 47 | }, 'created_at') |
| 48 | - ->value('editedAt', function ($date) { |
|
| 48 | + ->value('editedAt', function($date) { |
|
| 49 | 49 | return (new Carbon($date))->setTimezone('Europe/Moscow'); |
| 50 | 50 | }, 'updated_at') |
| 51 | - ->value('mentions', function ($mentions) { |
|
| 51 | + ->value('mentions', function($mentions) { |
|
| 52 | 52 | return static::parseMentions($mentions); |
| 53 | 53 | }) |
| 54 | 54 | ->only($fields) |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | $values['room_id'] = \App::make(Room::class)->id; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - return static::unguarded(function () use ($values) { |
|
| 61 | + return static::unguarded(function() use ($values) { |
|
| 62 | 62 | return new static($values); |
| 63 | 63 | }); |
| 64 | 64 | } |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | 16 | * @param Message $message |
| 17 | - * @return mixed |
|
| 17 | + * @return null|Message |
|
| 18 | 18 | */ |
| 19 | 19 | public function handle(Message $message) |
| 20 | 20 | { |
@@ -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) |
@@ -19,7 +19,6 @@ |
||
| 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 | /** |
@@ -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 09.10.2015 17: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 09.10.2015 17: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; |
| 12 | 12 | |
| 13 | 13 | use App\Gitter\Client; |
@@ -112,7 +112,7 @@ |
||
| 112 | 112 | { |
| 113 | 113 | $client = $this->client |
| 114 | 114 | ->stream('messages', ['roomId' => $this->id]) |
| 115 | - ->on(Stream::EVENT_MESSAGE, function ($stream, $data) { |
|
| 115 | + ->on(Stream::EVENT_MESSAGE, function($stream, $data) { |
|
| 116 | 116 | $this->onMessage(Message::fromGitterObject($data)); |
| 117 | 117 | }) |
| 118 | 118 | ->on(Stream::EVENT_END, [$this, 'onClose']) |
@@ -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 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; |
@@ -58,7 +58,7 @@ |
||
| 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 | } |
@@ -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 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; |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | /** |
| 77 | - * @return mixed|string |
|
| 77 | + * @return string |
|
| 78 | 78 | */ |
| 79 | 79 | public function getEscapedTextAttribute() |
| 80 | 80 | { |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | /** |
| 90 | - * @return mixed|string |
|
| 90 | + * @return string |
|
| 91 | 91 | */ |
| 92 | 92 | public function getTextWithoutSpecialCharsAttribute() |
| 93 | 93 | { |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | /** |
| 121 | - * @param $text |
|
| 121 | + * @param string $text |
|
| 122 | 122 | * @return Model |
| 123 | 123 | */ |
| 124 | 124 | public function pre($text) |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** |
| 130 | - * @param $code |
|
| 130 | + * @param string $code |
|
| 131 | 131 | * @param string $lang |
| 132 | 132 | * @return Model |
| 133 | 133 | */ |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /** |
| 160 | - * @param $symbol |
|
| 160 | + * @param string $symbol |
|
| 161 | 161 | * @param $text |
| 162 | 162 | * @return string |
| 163 | 163 | */ |
@@ -11,7 +11,6 @@ |
||
| 11 | 11 | namespace Domains; |
| 12 | 12 | |
| 13 | 13 | use Carbon\Carbon; |
| 14 | -use LogicException; |
|
| 15 | 14 | use Interfaces\Gitter\Client; |
| 16 | 15 | use Core\Mappers\MessageMapperTrait; |
| 17 | 16 | use Illuminate\Database\Eloquent\Model; |