@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | return [ |
129 | 129 | 'Content-Type' => 'application/json', |
130 | 130 | 'Accept' => 'application/json', |
131 | - 'Authorization' => 'Bearer ' . $this->token, |
|
131 | + 'Authorization' => 'Bearer '.$this->token, |
|
132 | 132 | ]; |
133 | 133 | } |
134 | 134 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | { |
205 | 205 | $this |
206 | 206 | ->stream('messages', ['roomId' => $room->id()]) |
207 | - ->on(Stream::EVENT_MESSAGE, function ($stream, $data) use($room) { |
|
207 | + ->on(Stream::EVENT_MESSAGE, function($stream, $data) use($room) { |
|
208 | 208 | $this->onMessage( |
209 | 209 | $room->middleware(), |
210 | 210 | Message::unguarded(function() use($room, $data) { |
@@ -272,9 +272,9 @@ discard block |
||
272 | 272 | protected function logException(\Exception $e) |
273 | 273 | { |
274 | 274 | \Log::error( |
275 | - $e->getMessage() . ' in ' . $e->getFile() . ':' . $e->getLine() . "\n" . |
|
276 | - $e->getTraceAsString() . "\n" . |
|
277 | - str_repeat('=', 80) . "\n" |
|
275 | + $e->getMessage().' in '.$e->getFile().':'.$e->getLine()."\n". |
|
276 | + $e->getTraceAsString()."\n". |
|
277 | + str_repeat('=', 80)."\n" |
|
278 | 278 | ); |
279 | 279 | } |
280 | 280 | |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | public function sendMessage(RoomInterface $room, $message) |
286 | 286 | { |
287 | 287 | $this->request('message.send', ['roomId' => $room->id()], [ |
288 | - 'text' => (string) $this->parser->parse($message), |
|
288 | + 'text' => (string)$this->parser->parse($message), |
|
289 | 289 | ], 'POST'); |
290 | 290 | } |
291 | 291 |
@@ -26,7 +26,7 @@ discard block |
||
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 |
||
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 | } |
@@ -27,7 +27,7 @@ |
||
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 | } |
@@ -38,19 +38,19 @@ |
||
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) |
@@ -81,7 +81,7 @@ |
||
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 | /** |
@@ -63,11 +63,11 @@ discard block |
||
63 | 63 | $this->container->bind($class, $class); |
64 | 64 | $instance = $this->container->make($class); |
65 | 65 | |
66 | - if (! ($instance instanceof MiddlewareInterface)) { |
|
66 | + if (!($instance instanceof MiddlewareInterface)) { |
|
67 | 67 | throw new \Exception("Class [{$class}] must be instance of Interfaces\\Gitter\\Middleware\\MiddlewareInterface"); |
68 | 68 | } |
69 | 69 | |
70 | - if ($instance instanceof MiddlewareGroupableInterface and ! $this->checkMiddlewareGroup($instance)) { |
|
70 | + if ($instance instanceof MiddlewareGroupableInterface and !$this->checkMiddlewareGroup($instance)) { |
|
71 | 71 | return $this; |
72 | 72 | } |
73 | 73 | |
@@ -104,16 +104,16 @@ discard block |
||
104 | 104 | */ |
105 | 105 | protected function checkMiddlewareGroup(MiddlewareGroupableInterface $middleware) |
106 | 106 | { |
107 | - $groups = (array) $middleware->getGroup(); |
|
107 | + $groups = (array)$middleware->getGroup(); |
|
108 | 108 | $currentGroups = \Config::get('gitter.env'); |
109 | 109 | |
110 | 110 | if (is_string($currentGroups)) { |
111 | - $currentGroups = array_map(function ($item) { |
|
111 | + $currentGroups = array_map(function($item) { |
|
112 | 112 | return trim($item); |
113 | 113 | }, explode(',', $currentGroups)); |
114 | 114 | } |
115 | 115 | |
116 | - if (! is_array($currentGroups)) { |
|
116 | + if (!is_array($currentGroups)) { |
|
117 | 117 | return true; |
118 | 118 | } |
119 | 119 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | $result = $client->initIndex('docs')->search($matches[3]); |
31 | 31 | |
32 | - if (! isset($result['hits'])) { |
|
32 | + if (!isset($result['hits'])) { |
|
33 | 33 | $message->italic('По вашему запросу ничего не найдено'); |
34 | 34 | return null; |
35 | 35 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $response .= "[*] [i][url={$row['link']}]{$title}[/url][/i]".PHP_EOL; |
55 | 55 | }); |
56 | 56 | |
57 | - if (! empty($response)) { |
|
57 | + if (!empty($response)) { |
|
58 | 58 | $message->answer(trans('search.results', [ |
59 | 59 | 'results' => '[i]Вот что нашел в документации:[/i] [list]'.PHP_EOL.$response.PHP_EOL.'[/list]' |
60 | 60 | ])); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | if ($isHello) { |
51 | 51 | $id = array_rand(trans('personal.hello')); |
52 | 52 | |
53 | - $message->italic(trans('personal.hello.' . $id, [ |
|
53 | + $message->italic(trans('personal.hello.'.$id, [ |
|
54 | 54 | 'user' => $message->user->login |
55 | 55 | ])); |
56 | 56 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | if ($isBan) { |
112 | 112 | $message->italic(sprintf( |
113 | - '@%s, тебе выданы ' . str_repeat(' :hammer: ', random_int(1, 9)) . ' на 0.' . random_int(1, 9) . ' секунды. Наслаждайся ;)', |
|
113 | + '@%s, тебе выданы '.str_repeat(' :hammer: ', random_int(1, 9)).' на 0.'.random_int(1, 9).' секунды. Наслаждайся ;)', |
|
114 | 114 | $message->user->login |
115 | 115 | )); |
116 | 116 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | |
130 | 130 | if ($isPolitics) { |
131 | 131 | $message->italic(sprintf( |
132 | - '@%s, за ' . $message->text_without_special_chars . '! ' . str_repeat(' :monkey: ', random_int(1, 9)), |
|
132 | + '@%s, за '.$message->text_without_special_chars.'! '.str_repeat(' :monkey: ', random_int(1, 9)), |
|
133 | 133 | $message->user->login |
134 | 134 | )); |
135 | 135 | } |
@@ -78,7 +78,7 @@ |
||
78 | 78 | */ |
79 | 79 | public function handle(RoomInterface $room) |
80 | 80 | { |
81 | - Achieve::created(function (Achieve $achieve) use($room) { |
|
81 | + Achieve::created(function(Achieve $achieve) use($room) { |
|
82 | 82 | $room->sendMessage( |
83 | 83 | trans('achieve.receiving', [ |
84 | 84 | 'user' => $achieve->user->login, |