@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | Route::get('/achievements', 'HomeController@index'); |
9 | 9 | |
10 | 10 | |
11 | -Route::group(['prefix' => 'api', 'namespace' => 'Api'], function () { |
|
11 | +Route::group(['prefix' => 'api', 'namespace' => 'Api'], function() { |
|
12 | 12 | // Users |
13 | 13 | Route::get('users.json', 'UsersController@index'); |
14 | 14 | Route::get('users/top.json', 'UsersController@getUsersTop'); |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | Route::get('achievements.json', 'AchievementsController@index'); |
19 | 19 | |
20 | 20 | |
21 | - Route::any('/{any}', function () { |
|
21 | + Route::any('/{any}', function() { |
|
22 | 22 | return ['error' => 'Not found']; |
23 | 23 | })->where('any', '.*?'); |
24 | 24 | }); |
25 | 25 | |
26 | 26 | |
27 | -Route::any('/{any}', function () { |
|
27 | +Route::any('/{any}', function() { |
|
28 | 28 | return Redirect::to('/'); |
29 | 29 | })->where('any', '.*?'); |
30 | 30 | \ No newline at end of file |
@@ -69,7 +69,7 @@ |
||
69 | 69 | * @param int $lifeTime The cache lifetime. |
70 | 70 | * If != 0, sets a specific lifetime for this cache entry (0 => infinite lifeTime). |
71 | 71 | * |
72 | - * @return boolean TRUE if the entry was successfully stored in the cache, FALSE otherwise. |
|
72 | + * @return boolean|null TRUE if the entry was successfully stored in the cache, FALSE otherwise. |
|
73 | 73 | */ |
74 | 74 | public function save($id, $data, $lifeTime = 0) |
75 | 75 | { |
@@ -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; |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | public function code($code, $lang = '') |
135 | 135 | { |
136 | 136 | return $this->answer( |
137 | - '```' . $lang . "\n" . $code . "\n" . '```' |
|
137 | + '```'.$lang."\n".$code."\n".'```' |
|
138 | 138 | ); |
139 | 139 | } |
140 | 140 | |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | $strings = explode("\n", $text); |
168 | 168 | foreach ($strings as $string) { |
169 | 169 | $result[] = |
170 | - $symbol . |
|
171 | - str_replace($symbol, '\\' . $symbol, trim($string)) . |
|
170 | + $symbol. |
|
171 | + str_replace($symbol, '\\'.$symbol, trim($string)). |
|
172 | 172 | $symbol; |
173 | 173 | } |
174 | 174 |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
172 | - * @param $route |
|
172 | + * @param string $route |
|
173 | 173 | * @param array $args |
174 | 174 | * @param string $method |
175 | 175 | * @return Stream |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | } |
182 | 182 | |
183 | 183 | /** |
184 | - * @param $route |
|
184 | + * @param string $route |
|
185 | 185 | * @param array $args |
186 | 186 | * @param null $content |
187 | 187 | * @param string $method |
@@ -41,14 +41,14 @@ discard block |
||
41 | 41 | public static function make($token, $roomId) |
42 | 42 | { |
43 | 43 | $client = new Client($token); |
44 | - App::singleton(Client::class, function () use ($client) { |
|
44 | + App::singleton(Client::class, function() use ($client) { |
|
45 | 45 | return $client; |
46 | 46 | }); |
47 | 47 | App::alias(Client::class, 'gitter'); |
48 | 48 | |
49 | 49 | |
50 | 50 | $room = new Room($roomId); |
51 | - App::singleton(Room::class, function () use ($room) { |
|
51 | + App::singleton(Room::class, function() use ($room) { |
|
52 | 52 | return $room; |
53 | 53 | }); |
54 | 54 | App::alias(Room::class, 'room'); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | return [ |
141 | 141 | 'Content-Type' => 'application/json', |
142 | 142 | 'Accept' => 'application/json', |
143 | - 'Authorization' => 'Bearer ' . $this->token, |
|
143 | + 'Authorization' => 'Bearer '.$this->token, |
|
144 | 144 | ]; |
145 | 145 | } |
146 | 146 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | |
49 | 49 | preg_match_all('/\w+/iu', $text, $words, PREG_PATTERN_ORDER); |
50 | 50 | |
51 | - return array_map(function ($word) { |
|
51 | + return array_map(function($word) { |
|
52 | 52 | return mb_strtolower($word); |
53 | 53 | }, $words[0]); |
54 | 54 | } |
@@ -88,7 +88,7 @@ |
||
88 | 88 | |
89 | 89 | /** @var User $mention */ |
90 | 90 | foreach ($message->mentions as $mention) { |
91 | - $question = $this->buffer->last(function ($i, Message $question) use ($mention) { |
|
91 | + $question = $this->buffer->last(function($i, Message $question) use ($mention) { |
|
92 | 92 | if ($question->user) { |
93 | 93 | return $question->user->getId() === $mention->getId(); |
94 | 94 | } |
@@ -30,12 +30,12 @@ |
||
30 | 30 | $config = $this->app->make(Repository::class); |
31 | 31 | |
32 | 32 | |
33 | - $this->app->singleton(Client::class, function (Container $app) use ($config) { |
|
33 | + $this->app->singleton(Client::class, function(Container $app) use ($config) { |
|
34 | 34 | return new Client($config->get('gitter.token')); |
35 | 35 | }); |
36 | 36 | |
37 | 37 | |
38 | - $this->app->singleton('bot', function (Container $app) { |
|
38 | + $this->app->singleton('bot', function(Container $app) { |
|
39 | 39 | /** @var Client $client */ |
40 | 40 | $client = $app->make(Client::class); |
41 | 41 | return $client->http->getCurrentUser()->wait(); |
@@ -37,7 +37,7 @@ |
||
37 | 37 | |
38 | 38 | $user = User::where('gitter_id', $values['gitter_id'])->first(); |
39 | 39 | if (!$user) { |
40 | - $user = User::unguarded(function () use ($values) { |
|
40 | + $user = User::unguarded(function() use ($values) { |
|
41 | 41 | return User::create($values); |
42 | 42 | }); |
43 | 43 | } |
@@ -35,11 +35,11 @@ |
||
35 | 35 | */ |
36 | 36 | public function register() |
37 | 37 | { |
38 | - AnnotationRegistry::registerLoader(function ($class) { |
|
38 | + AnnotationRegistry::registerLoader(function($class) { |
|
39 | 39 | return class_exists($class); |
40 | 40 | }); |
41 | 41 | |
42 | - $this->app->singleton(Reader::class, function (Application $app) { |
|
42 | + $this->app->singleton(Reader::class, function(Application $app) { |
|
43 | 43 | $debug = $app->make(Repository::class)->get('app.debug', false); |
44 | 44 | $cache = $app->make($debug ? ArrayCache::class : CacheBridge::class); |
45 | 45 |