Completed
Push — master ( 31e2c8...8fd6c7 )
by Kirill
11s
created
app/Interfaces/Slack/UserMapper.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,6 @@
 block discarded – undo
20 20
 class UserMapper
21 21
 {
22 22
     /**
23
-     * @param array|\StdClass $attributes
24 23
      * @return User
25 24
      * @throws InvalidArgumentException
26 25
      */
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public static function fromSlackObject(\Slack\User $user)
28 28
     {
29
-        $values = (new AttributeMapper((array) $user->data))
29
+        $values = (new AttributeMapper((array)$user->data))
30 30
             ->rename('id', 'gitter_id')
31 31
             ->rename('name', 'login')
32 32
             ->rename('real_name', 'name')
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
         $user = User::where('gitter_id', $values['gitter_id'])->first();
40 40
         if (!$user) {
41
-            $user = User::unguarded(function () use ($values) {
41
+            $user = User::unguarded(function() use ($values) {
42 42
                 return User::create($values);
43 43
             });
44 44
         }
Please login to merge, or discard this patch.
app/Interfaces/Slack/TextParser.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 
22 22
         $this->text = preg_replace_callback('%\[url\s*=\s*("(?:[^"]*")|\A[^\']*\Z|(?:[^\'">\]\s]+))\s*(?:[^]\s]*)\]([\W\D\w\s]*?)\[/url\]%iu',
23 23
 
24
-            function ($matches) {
24
+            function($matches) {
25 25
                 if (isset($matches[1]) && isset($matches[2]))
26 26
                     return "<".$matches[1]."|".$matches[2].">";
27 27
                 else
Please login to merge, or discard this patch.
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,10 +22,11 @@
 block discarded – undo
22 22
         $this->text = preg_replace_callback('%\[url\s*=\s*("(?:[^"]*")|\A[^\']*\Z|(?:[^\'">\]\s]+))\s*(?:[^]\s]*)\]([\W\D\w\s]*?)\[/url\]%iu',
23 23
 
24 24
             function ($matches) {
25
-                if (isset($matches[1]) && isset($matches[2]))
26
-                    return "<".$matches[1]."|".$matches[2].">";
27
-                else
28
-                    throw new \RuntimeException(sprintf("Text identified by '%d' has malformed BBCode urls", $this->id));
25
+                if (isset($matches[1]) && isset($matches[2])) {
26
+                                    return "<".$matches[1]."|".$matches[2].">";
27
+                } else {
28
+                                    throw new \RuntimeException(sprintf("Text identified by '%d' has malformed BBCode urls", $this->id));
29
+                }
29 30
             },
30 31
 
31 32
             $this->text
Please login to merge, or discard this patch.
app/Interfaces/Slack/Client.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -67,9 +67,9 @@  discard block
 block discarded – undo
67 67
      */
68 68
     public function sendMessage(RoomInterface $room, $message)
69 69
     {
70
-        $this->client->getChannelById($room->id())->then(function (\Slack\Channel $channel) use($message) {
70
+        $this->client->getChannelById($room->id())->then(function(\Slack\Channel $channel) use($message) {
71 71
             $this->client->apiCall('chat.postMessage', [
72
-                'text' => (string) $this->parser->parse($message),
72
+                'text' => (string)$this->parser->parse($message),
73 73
                 'channel' => $channel->getId(),
74 74
                 'as_user' => true,
75 75
             ]);
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     public function listen(RoomInterface $room)
85 85
     {
86
-        $this->client->on('message', function (\Slack\Payload $msg) use($room) {
86
+        $this->client->on('message', function(\Slack\Payload $msg) use($room) {
87 87
             if ($msg->getData()['channel'] != $room->id()) {
88 88
                 return;
89 89
             }
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
             );
100 100
         });
101 101
 
102
-        $this->client->on('reaction_added', function (\Slack\Payload $payload) use($room) {
102
+        $this->client->on('reaction_added', function(\Slack\Payload $payload) use($room) {
103 103
             if ($payload->getData()['item']['type'] != 'message' and $payload->getData()['item']['channel'] != $room->id()) {
104 104
                 return;
105 105
             }
@@ -172,9 +172,9 @@  discard block
 block discarded – undo
172 172
     protected function logException(\Exception $e)
173 173
     {
174 174
         \Log::error(
175
-            $e->getMessage() . ' in ' . $e->getFile() . ':' . $e->getLine() . "\n" .
176
-            $e->getTraceAsString() . "\n" .
177
-            str_repeat('=', 80) . "\n"
175
+            $e->getMessage().' in '.$e->getFile().':'.$e->getLine()."\n".
176
+            $e->getTraceAsString()."\n".
177
+            str_repeat('=', 80)."\n"
178 178
         );
179 179
     }
180 180
 
Please login to merge, or discard this patch.
app/Interfaces/Slack/MessageMapper.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,13 +35,13 @@
 block discarded – undo
35 35
 
36 36
         $this->attributes = (new AttributeMapper($attributes))
37 37
             ->rename('channel', 'room_id')
38
-            ->value('user', function ($user) use($room) {
38
+            ->value('user', function($user) use($room) {
39 39
                 return $room->client()->getUserById($user);
40 40
             })
41
-            ->value('ts', function ($date) {
41
+            ->value('ts', function($date) {
42 42
                 return Carbon::createFromTimestamp($date)->setTimezone('Europe/Moscow');
43 43
             }, 'created_at')
44
-            ->value('mentions', function ($ids) use($room) {
44
+            ->value('mentions', function($ids) use($room) {
45 45
                 $users = [];
46 46
                 if (is_array($ids)) {
47 47
                     foreach ($ids as $userId) {
Please login to merge, or discard this patch.
app/Interfaces/Gitter/UserMapper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
      */
27 27
     public static function fromGitterObject($attributes)
28 28
     {
29
-        $values = (new AttributeMapper((array) $attributes))
29
+        $values = (new AttributeMapper((array)$attributes))
30 30
             ->rename('id', 'gitter_id')
31 31
             ->rename('username', 'login')
32 32
             ->rename('displayName', 'name')
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
         $user = User::where('gitter_id', $values['gitter_id'])->first();
38 38
         if (!$user) {
39
-            $user = User::unguarded(function () use ($values) {
39
+            $user = User::unguarded(function() use ($values) {
40 40
                 return User::create($values);
41 41
             });
42 42
         }
Please login to merge, or discard this patch.
app/Interfaces/Gitter/StandartGitterRoom.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         parent::__construct();
28 28
 
29 29
         $this->alias = $alias;
30
-        $this->groups = (array) $groups;
30
+        $this->groups = (array)$groups;
31 31
 
32 32
         $this->setMiddleware($middleware);
33 33
     }
Please login to merge, or discard this patch.
app/Interfaces/Gitter/MessageMapper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,19 +38,19 @@
 block discarded – undo
38 38
         $this->attributes = (new AttributeMapper($attributes))
39 39
             ->rename('readBy', 'read_by')
40 40
             ->rename('id', 'gitter_id')
41
-            ->value('editedAt', function ($val) {
41
+            ->value('editedAt', function($val) {
42 42
                 return !!$val;
43 43
             }, 'edited')
44
-            ->value('fromUser', function ($user) {
44
+            ->value('fromUser', function($user) {
45 45
                 return UserMapper::fromGitterObject($user);
46 46
             }, 'user')
47
-            ->value('sent', function ($date) {
47
+            ->value('sent', function($date) {
48 48
                 return (new Carbon($date))->setTimezone('Europe/Moscow');
49 49
             }, 'created_at')
50
-            ->value('editedAt', function ($date) {
50
+            ->value('editedAt', function($date) {
51 51
                 return (new Carbon($date))->setTimezone('Europe/Moscow');
52 52
             }, 'updated_at')
53
-            ->value('mentions', function ($mentions) {
53
+            ->value('mentions', function($mentions) {
54 54
                 return $this->parseMentions($mentions);
55 55
             })
56 56
             ->only($fields)
Please login to merge, or discard this patch.
app/Interfaces/Console/Commands/StartGitterPool.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
                 $this->stop();
77 77
                 break;
78 78
             default:
79
-                throw new \InvalidArgumentException('Action ' . $action . ' not found');
79
+                throw new \InvalidArgumentException('Action '.$action.' not found');
80 80
         }
81 81
     }
82 82
 
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             $bg = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? 'start /min /normal' : 'nohup';
90 90
 
91 91
             shell_exec("{$bg} php artisan gitter:listen {$room->id()}");
92
-            $this->line('Starting ' . $room->id() . ' listener.');
92
+            $this->line('Starting '.$room->id().' listener.');
93 93
         }
94 94
     }
95 95
 
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
 
106 106
         foreach ($finder as $file) {
107 107
             $pid = file_get_contents($file->getRealpath());
108
-            shell_exec('kill ' . $pid);
108
+            shell_exec('kill '.$pid);
109 109
             unlink($file->getRealpath());
110 110
         }
111 111
     }
Please login to merge, or discard this patch.
app/Domains/Room/AbstractRoom.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -81,7 +81,7 @@
 block discarded – undo
81 81
      */
82 82
     public function groups()
83 83
     {
84
-        return (array) $this->groups;
84
+        return (array)$this->groups;
85 85
     }
86 86
 
87 87
     /**
Please login to merge, or discard this patch.