@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | */ |
364 | 364 | public static function getChildren($categoryId) |
365 | 365 | { |
366 | - return Cache::flexible(md5($categoryId), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function () use ($categoryId) { |
|
366 | + return Cache::flexible(md5($categoryId), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function() use ($categoryId) { |
|
367 | 367 | return RootCategory::find($categoryId)->categories; |
368 | 368 | }); |
369 | 369 | } |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | public static function getByIds($ids) |
400 | 400 | { |
401 | 401 | if (\count($ids) > 0) { |
402 | - return Cache::flexible(md5(md5(implode(',', $ids))), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function () use ($ids) { |
|
402 | + return Cache::flexible(md5(md5(implode(',', $ids))), [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function() use ($ids) { |
|
403 | 403 | return self::query()->whereIn('id', $ids)->get(); |
404 | 404 | }); |
405 | 405 | } |
@@ -446,15 +446,15 @@ discard block |
||
446 | 446 | public static function getForMenu(array $excludedCats = []): array |
447 | 447 | { |
448 | 448 | $categoriesResult = []; |
449 | - $categoriesArray = RootCategory::query()->with(['categories' => function ($query) use ($excludedCats) { |
|
450 | - if (! empty($excludedCats)) { |
|
449 | + $categoriesArray = RootCategory::query()->with(['categories' => function($query) use ($excludedCats) { |
|
450 | + if (!empty($excludedCats)) { |
|
451 | 451 | $query->whereNotIn('id', $excludedCats); |
452 | 452 | } |
453 | 453 | $query->select(['id', 'title', 'root_categories_id', 'description']); |
454 | 454 | }])->select(['id', 'title'])->get()->toArray(); |
455 | 455 | |
456 | 456 | foreach ($categoriesArray as $category) { |
457 | - if (! empty($category['categories'])) { |
|
457 | + if (!empty($category['categories'])) { |
|
458 | 458 | $categoriesResult[] = $category; |
459 | 459 | } |
460 | 460 | } |
@@ -467,7 +467,7 @@ discard block |
||
467 | 467 | */ |
468 | 468 | public static function getForApi() |
469 | 469 | { |
470 | - return Cache::flexible('ForApi', [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function () { |
|
470 | + return Cache::flexible('ForApi', [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function() { |
|
471 | 471 | return RootCategory::query()->select(['id', 'title'])->where('status', '=', self::STATUS_ACTIVE)->get(); |
472 | 472 | }); |
473 | 473 | } |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | $sql->where('status', '=', self::STATUS_ACTIVE); |
505 | 505 | } |
506 | 506 | |
507 | - if (! empty($excludedCats)) { |
|
507 | + if (!empty($excludedCats)) { |
|
508 | 508 | $sql->whereNotIn('id', $excludedCats); |
509 | 509 | } |
510 | 510 |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | if (\in_array($siteColumn, self::$sites, false)) { |
101 | 101 | $result = Video::query()->where($siteColumn, $siteID)->first(); |
102 | 102 | } |
103 | - if (! empty($result)) { |
|
103 | + if (!empty($result)) { |
|
104 | 104 | $query = $result->toArray(); |
105 | 105 | |
106 | 106 | return $query['id']; |
@@ -180,13 +180,13 @@ discard block |
||
180 | 180 | public function getTitleExact(string $title, int $type, int $source = 0): int |
181 | 181 | { |
182 | 182 | $return = 0; |
183 | - if (! empty($title)) { |
|
183 | + if (!empty($title)) { |
|
184 | 184 | $sql = Video::query()->where(['title' => $title, 'type' => $type]); |
185 | 185 | if ($source > 0) { |
186 | 186 | $sql->where('source', $source); |
187 | 187 | } |
188 | 188 | $query = $sql->first(); |
189 | - if (! empty($query)) { |
|
189 | + if (!empty($query)) { |
|
190 | 190 | $result = $query->toArray(); |
191 | 191 | $return = $result['id']; |
192 | 192 | } |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | $sql->where('videos.source', $source); |
200 | 200 | } |
201 | 201 | $query = $sql->first(); |
202 | - if (! empty($query)) { |
|
202 | + if (!empty($query)) { |
|
203 | 203 | $result = $query->toArray(); |
204 | 204 | $return = $result['id']; |
205 | 205 | } |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | { |
217 | 217 | $return = 0; |
218 | 218 | |
219 | - if (! empty($title)) { |
|
219 | + if (!empty($title)) { |
|
220 | 220 | $sql = Video::query() |
221 | 221 | ->where('title', 'like', rtrim($title, '%')) |
222 | 222 | ->where('type', $type); |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $sql->where('source', $source); |
225 | 225 | } |
226 | 226 | $query = $sql->first(); |
227 | - if (! empty($query)) { |
|
227 | + if (!empty($query)) { |
|
228 | 228 | $result = $query->toArray(); |
229 | 229 | $return = $result['id']; |
230 | 230 | } |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | $sql->where('videos.source', $source); |
239 | 239 | } |
240 | 240 | $query = $sql->first(); |
241 | - if (! empty($query)) { |
|
241 | + if (!empty($query)) { |
|
242 | 242 | $result = $query->toArray(); |
243 | 243 | $return = $result['id']; |
244 | 244 | } |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | public function getAlternativeTitleExact(string $title, int $type, int $source = 0): mixed |
255 | 255 | { |
256 | 256 | $return = 0; |
257 | - if (! empty($title)) { |
|
257 | + if (!empty($title)) { |
|
258 | 258 | if ($source > 0) { |
259 | 259 | $query = Video::query() |
260 | 260 | ->whereRaw("REPLACE(title,'\'','') = ?", $title) |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | ->where('type', '=', $type) |
270 | 270 | ->first(); |
271 | 271 | } |
272 | - if (! empty($query)) { |
|
272 | + if (!empty($query)) { |
|
273 | 273 | $result = $query->toArray(); |
274 | 274 | |
275 | 275 | return $result['id']; |
@@ -284,10 +284,10 @@ discard block |
||
284 | 284 | */ |
285 | 285 | public function addAliases($videoId, array $aliases = []): void |
286 | 286 | { |
287 | - if (! empty($aliases) && $videoId > 0) { |
|
287 | + if (!empty($aliases) && $videoId > 0) { |
|
288 | 288 | foreach ($aliases as $key => $title) { |
289 | 289 | // Check for tvmaze style aka |
290 | - if (\is_array($title) && ! empty($title['name'])) { |
|
290 | + if (\is_array($title) && !empty($title['name'])) { |
|
291 | 291 | $title = $title['name']; |
292 | 292 | } |
293 | 293 | // Check if we have the AKA already |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | $sql->where('title', $alias); |
316 | 316 | } |
317 | 317 | |
318 | - return Cache::flexible($cacheKey, [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function () use ($sql) { |
|
318 | + return Cache::flexible($cacheKey, [config('nntmux.cache_expiry_medium'), config('nntmux.cache_expiry_long')], function() use ($sql) { |
|
319 | 319 | $result = $sql->get(); |
320 | 320 | |
321 | 321 | return $result->isEmpty() ? false : $result; |