Passed
Push — master ( 5d5926...04c44e )
by Darko
16:19
created
app/Models/Category.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -486,15 +486,15 @@  discard block
 block discarded – undo
486 486
     public static function getForMenu(array $excludedCats = []): array
487 487
     {
488 488
         $categoriesResult = [];
489
-        $categoriesArray = RootCategory::query()->with(['categories' => function ($query) use ($excludedCats) {
490
-            if (! empty($excludedCats)) {
489
+        $categoriesArray = RootCategory::query()->with(['categories' => function($query) use ($excludedCats) {
490
+            if (!empty($excludedCats)) {
491 491
                 $query->whereNotIn('id', $excludedCats);
492 492
             }
493 493
             $query->select(['id', 'title', 'root_categories_id', 'description']);
494 494
         }])->select(['id', 'title'])->get()->toArray();
495 495
 
496 496
         foreach ($categoriesArray as $category) {
497
-            if (! empty($category['categories'])) {
497
+            if (!empty($category['categories'])) {
498 498
                 $categoriesResult[] = $category;
499 499
             }
500 500
         }
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
             $sql->where('status', '=', self::STATUS_ACTIVE);
553 553
         }
554 554
 
555
-        if (! empty($excludedCats)) {
555
+        if (!empty($excludedCats)) {
556 556
             $sql->whereNotIn('id', $excludedCats);
557 557
         }
558 558
 
Please login to merge, or discard this patch.
app/Http/Controllers/Api/RSS.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
             Category::TV_ROOT,
138 138
             Category::TV_OTHER,
139 139
             $this->releases->showPasswords(),
140
-            ! empty($limit) ? sprintf(' LIMIT %d OFFSET 0', $limit > 100 ? 100 : $limit) : ''
140
+            !empty($limit) ? sprintf(' LIMIT %d OFFSET 0', $limit > 100 ? 100 : $limit) : ''
141 141
         );
142 142
 
143 143
         $expiresAt = now()->addMinutes(config('nntmux.cache_expiry_medium'));
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
             Category::MOVIE_ROOT,
190 190
             Category::MOVIE_OTHER,
191 191
             $this->releases->showPasswords(),
192
-            ! empty($limit) ? sprintf(' LIMIT %d OFFSET 0', $limit > 100 ? 100 : $limit) : ''
192
+            !empty($limit) ? sprintf(' LIMIT %d OFFSET 0', $limit > 100 ? 100 : $limit) : ''
193 193
         );
194 194
 
195 195
         $expiresAt = now()->addMinutes(config('nntmux.cache_expiry_medium'));
Please login to merge, or discard this patch.
Blacklight/Genres.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
     private function getListQuery(string $type = '', bool $activeOnly = false): string
59 59
     {
60
-        if (! empty($type)) {
60
+        if (!empty($type)) {
61 61
             $typesql = sprintf(' AND g.type = %d', $type);
62 62
         } else {
63 63
             $typesql = '';
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 
104 104
     public function getCount(string $type = '', bool $activeOnly = false): mixed
105 105
     {
106
-        if (! empty($type)) {
106
+        if (!empty($type)) {
107 107
             $typesql = sprintf(' AND g.type = %d', $type);
108 108
         } else {
109 109
             $typesql = '';
Please login to merge, or discard this patch.
Blacklight/Games.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     {
299 299
         $browseBy = ' ';
300 300
         foreach ($this->getBrowseByOptions() as $bbk => $bbv) {
301
-            if (! empty($_REQUEST[$bbk])) {
301
+            if (!empty($_REQUEST[$bbk])) {
302 302
                 $bbs = stripslashes($_REQUEST[$bbk]);
303 303
                 if ($bbk === 'year') {
304 304
                     $browseBy .= ' AND YEAR (gi.releasedate) '.'LIKE '.escapeString('%'.$bbs.'%');
@@ -362,11 +362,11 @@  discard block
 block discarded – undo
362 362
                 if (empty($this->_gameResults['title'])) {
363 363
                     return false;
364 364
                 }
365
-                if (! empty($this->_gameResults['cover'])) {
365
+                if (!empty($this->_gameResults['cover'])) {
366 366
                     $game['coverurl'] = (string) $this->_gameResults['cover'];
367 367
                 }
368 368
 
369
-                if (! empty($this->_gameResults['backdrop'])) {
369
+                if (!empty($this->_gameResults['backdrop'])) {
370 370
                     $game['backdropurl'] = (string) $this->_gameResults['backdrop'];
371 371
                 }
372 372
 
@@ -374,41 +374,41 @@  discard block
 block discarded – undo
374 374
                 $game['asin'] = $this->_gameResults['steamid'];
375 375
                 $game['url'] = (string) $this->_gameResults['directurl'];
376 376
 
377
-                if (! empty($this->_gameResults['publisher'])) {
377
+                if (!empty($this->_gameResults['publisher'])) {
378 378
                     $game['publisher'] = (string) $this->_gameResults['publisher'];
379 379
                 } else {
380 380
                     $game['publisher'] = 'Unknown';
381 381
                 }
382 382
 
383
-                if (! empty($this->_gameResults['rating'])) {
383
+                if (!empty($this->_gameResults['rating'])) {
384 384
                     $game['esrb'] = (string) $this->_gameResults['rating'];
385 385
                 } else {
386 386
                     $game['esrb'] = 'Not Rated';
387 387
                 }
388 388
 
389
-                if (! empty($this->_gameResults['releasedate'])) {
389
+                if (!empty($this->_gameResults['releasedate'])) {
390 390
                     $dateReleased = strtotime($this->_gameResults['releasedate']) === false ? '' : $this->_gameResults['releasedate'];
391 391
                     $game['releasedate'] = ($this->_gameResults['releasedate'] === '' || strtotime($this->_gameResults['releasedate']) === false) ? null : Carbon::createFromFormat('M j, Y', Carbon::parse($dateReleased)->toFormattedDateString())->format('Y-m-d');
392 392
                 }
393 393
 
394
-                if (! empty($this->_gameResults['description'])) {
394
+                if (!empty($this->_gameResults['description'])) {
395 395
                     $game['review'] = (string) $this->_gameResults['description'];
396 396
                 }
397 397
 
398
-                if (! empty($this->_gameResults['genres'])) {
398
+                if (!empty($this->_gameResults['genres'])) {
399 399
                     $genres = $this->_gameResults['genres'];
400 400
                     $genreName = $this->_matchGenre($genres);
401 401
                 }
402 402
             }
403 403
         }
404 404
 
405
-        if (! empty($this->publicKey)) {
405
+        if (!empty($this->publicKey)) {
406 406
             if ($steamGameID === false || $this->_gameResults === false) {
407 407
                 $bestMatch = false;
408 408
                 $this->_classUsed = 'GiantBomb';
409 409
                 try {
410 410
                     $result = $this->giantBomb->search($gameInfo['title'], 'Game');
411
-                    if (! \is_object($result)) {
411
+                    if (!\is_object($result)) {
412 412
                         $bestMatchPct = 0;
413 413
                         foreach ($result as $res) {
414 414
                             similar_text(strtolower($gameInfo['title']), strtolower($res->name), $percent1);
@@ -421,17 +421,17 @@  discard block
 block discarded – undo
421 421
                         if ($bestMatch !== false) {
422 422
                             $this->_gameResults = $this->giantBomb->findWithResourceID('Game', '3030-'.$bestMatch);
423 423
 
424
-                            if (! empty($this->_gameResults->image['medium_url'])) {
424
+                            if (!empty($this->_gameResults->image['medium_url'])) {
425 425
                                 $game['coverurl'] = (string) $this->_gameResults->image['medium_url'];
426 426
                             }
427 427
 
428
-                            if (! empty($this->_gameResults->image['screen_url'])) {
428
+                            if (!empty($this->_gameResults->image['screen_url'])) {
429 429
                                 $game['backdropurl'] = (string) $this->_gameResults->image['screen_url'];
430 430
                             }
431 431
 
432 432
                             $game['title'] = (string) $this->_gameResults->get('name');
433 433
                             $game['asin'] = $this->_gameResults->get('id');
434
-                            if (! empty($this->_gameResults->get('site_detail_url'))) {
434
+                            if (!empty($this->_gameResults->get('site_detail_url'))) {
435 435
                                 $game['url'] = (string) $this->_gameResults->get('site_detail_url');
436 436
                             } else {
437 437
                                 $game['url'] = '';
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
                                 $game['publisher'] = 'Unknown';
444 444
                             }
445 445
 
446
-                            if (! empty($this->_gameResults->original_game_rating[0]['name'])) {
446
+                            if (!empty($this->_gameResults->original_game_rating[0]['name'])) {
447 447
                                 $game['esrb'] = $this->_gameResults->original_game_rating[0]['name'] ?? 'Not Rated';
448 448
                             } else {
449 449
                                 $game['esrb'] = 'Not Rated';
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
                     $bestMatch = false;
481 481
                     $this->_classUsed = 'IGDB';
482 482
                     $result = Game::where('name', $gameInfo['title'])->get();
483
-                    if (! empty($result)) {
483
+                    if (!empty($result)) {
484 484
                         $bestMatchPct = 0;
485 485
                         foreach ($result as $res) {
486 486
                             similar_text(strtolower($gameInfo['title']), strtolower($res->name), $percent1);
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
                             ])->where('id', $bestMatch)->first();
499 499
 
500 500
                             $publishers = [];
501
-                            if (! empty($this->_gameResults->involved_companies)) {
501
+                            if (!empty($this->_gameResults->involved_companies)) {
502 502
                                 foreach ($this->_gameResults->involved_companies as $publisher) {
503 503
                                     if ($publisher['publisher'] === true) {
504 504
                                         $company = Company::find($publisher['company']);
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
 
510 510
                             $genres = [];
511 511
 
512
-                            if (! empty($this->_gameResults->themes)) {
512
+                            if (!empty($this->_gameResults->themes)) {
513 513
                                 foreach ($this->_gameResults->themes as $theme) {
514 514
                                     $genres[] = $theme['name'];
515 515
                                 }
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
                                 'esrb' => isset($this->_gameResults->aggregated_rating) ? round($this->_gameResults->aggregated_rating).'%' : 'Not Rated',
532 532
                                 'url' => $this->_gameResults->url ?? '',
533 533
                                 'backdropurl' => isset($this->_gameResults->screenshots) ? 'https:'.str_replace('t_thumb', 't_cover_big', $this->_gameResults->screenshots[0]['url']) : '',
534
-                                'publisher' => ! empty($publishers) ? implode(',', $publishers) : 'Unknown',
534
+                                'publisher' => !empty($publishers) ? implode(',', $publishers) : 'Unknown',
535 535
                             ];
536 536
                         } else {
537 537
                             $this->colorCli->notice('IGDB returned no valid results');
@@ -565,20 +565,20 @@  discard block
 block discarded – undo
565 565
         } else {
566 566
             $game['backdrop'] = 0;
567 567
         }
568
-        if (! isset($game['trailer'])) {
568
+        if (!isset($game['trailer'])) {
569 569
             $game['trailer'] = 0;
570 570
         }
571 571
         if (empty($game['title'])) {
572 572
             $game['title'] = $gameInfo['title'];
573 573
         }
574
-        if (! isset($game['releasedate'])) {
574
+        if (!isset($game['releasedate'])) {
575 575
             $game['releasedate'] = '';
576 576
         }
577 577
 
578 578
         if ($game['releasedate'] === '') {
579 579
             $game['releasedate'] = '';
580 580
         }
581
-        if (! isset($game['review'])) {
581
+        if (!isset($game['review'])) {
582 582
             $game['review'] = 'No Review';
583 583
         }
584 584
         $game['classused'] = $this->_classUsed;
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
         $game['gamesgenre'] = $genreName;
597 597
         $game['gamesgenreID'] = $genreKey;
598 598
 
599
-        if (! empty($game['asin'])) {
599
+        if (!empty($game['asin'])) {
600 600
             $check = GamesInfo::query()->where('asin', $game['asin'])->first();
601 601
             if ($check === null) {
602 602
                 $gamesId = GamesInfo::query()
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
             }
642 642
         }
643 643
 
644
-        if (! empty($gamesId)) {
644
+        if (!empty($gamesId)) {
645 645
             if ($this->echoOutput) {
646 646
                 $this->colorCli->header('Added/updated game: ').
647 647
                     $this->colorCli->alternateOver('   Title:    ').
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
                 $this->colorCli->primary($game['title'].' (PC)');
661 661
         }
662 662
 
663
-        return ! empty($gamesId) ? $gamesId : false;
663
+        return !empty($gamesId) ? $gamesId : false;
664 664
     }
665 665
 
666 666
     /**
Please login to merge, or discard this patch.
Blacklight/Music.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
 			%s %s %s
196 196
 			GROUP BY m.id
197 197
 			ORDER BY %s %s',
198
-            ! empty($musicIDs) ? 'WHERE m.id IN ('.implode(',', $musicIDs).')' : 'AND 1=1',
199
-            (! empty($releaseIDs)) ? 'AND r.id in ('.implode(',', $releaseIDs).')' : '',
198
+            !empty($musicIDs) ? 'WHERE m.id IN ('.implode(',', $musicIDs).')' : 'AND 1=1',
199
+            (!empty($releaseIDs)) ? 'AND r.id in ('.implode(',', $releaseIDs).')' : '',
200 200
             $catsrch,
201 201
             $order[0],
202 202
             $order[1]
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
     {
262 262
         $browseby = ' ';
263 263
         foreach ($this->getBrowseByOptions() as $bbk => $bbv) {
264
-            if (! empty($_REQUEST[$bbk])) {
264
+            if (!empty($_REQUEST[$bbk])) {
265 265
                 $bbs = stripslashes($_REQUEST[$bbk]);
266 266
                 if (stripos($bbv, 'id') !== false) {
267 267
                     $browseby .= ' AND m.'.$bbv.' = '.$bbs;
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
             )
414 414
         );
415 415
 
416
-        if (! empty($res)) {
416
+        if (!empty($res)) {
417 417
             foreach ($res as $arr) {
418 418
                 $startTime = now();
419 419
                 $usedAmazon = false;
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
             $h = trim(preg_replace('/\s\s+/', ' ', $g));
487 487
             $newname = trim(preg_replace('/ [a-z]{2}$| [a-z]{3} \d{2,}$|\d{5,} \d{5,}$|-WEB$/i', '', $h));
488 488
 
489
-            if (! preg_match('/^[a-z0-9]+$/i', $newname) && strlen($newname) > 10) {
489
+            if (!preg_match('/^[a-z0-9]+$/i', $newname) && strlen($newname) > 10) {
490 490
                 $result['name'] = $newname;
491 491
 
492 492
                 return $result;
Please login to merge, or discard this patch.
Blacklight/Console.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
     {
276 276
         $browseBy = ' ';
277 277
         foreach ($this->getBrowseByOptions() as $bbk => $bbv) {
278
-            if (! empty($_REQUEST[$bbk])) {
278
+            if (!empty($_REQUEST[$bbk])) {
279 279
                 $bbs = stripslashes($_REQUEST[$bbk]);
280 280
                 $browseBy .= ' AND con.'.$bbv.' LIKE '.escapeString('%'.$bbs.'%');
281 281
             }
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
         $con['esrb'] = (string) $amaz->ItemAttributes->ESRBAgeRating;
401 401
         $con['releasedate'] = (string) $amaz->ItemAttributes->ReleaseDate;
402 402
 
403
-        if (! isset($con['releasedate'])) {
403
+        if (!isset($con['releasedate'])) {
404 404
             $con['releasedate'] = '';
405 405
         }
406 406
 
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
         if (config('config.credentials.client_id') !== '' && config('config.credentials.client_secret') !== '') {
629 629
             try {
630 630
                 $result = Game::where('name', $gameInfo)->get();
631
-                if (! empty($result)) {
631
+                if (!empty($result)) {
632 632
                     $bestMatchPct = 0;
633 633
                     foreach ($result as $res) {
634 634
                         similar_text(strtolower($gameInfo), strtolower($res->name), $percent);
@@ -646,7 +646,7 @@  discard block
 block discarded – undo
646 646
                         ])->where('id', $bestMatch)->first();
647 647
 
648 648
                         $publishers = [];
649
-                        if (! empty($game->involved_companies)) {
649
+                        if (!empty($game->involved_companies)) {
650 650
                             foreach ($game->involved_companies as $publisher) {
651 651
                                 if ($publisher['publisher'] === true) {
652 652
                                     $company = Company::find($publisher['company']);
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
 
658 658
                         $genres = [];
659 659
 
660
-                        if (! empty($game->themes)) {
660
+                        if (!empty($game->themes)) {
661 661
                             foreach ($game->themes as $theme) {
662 662
                                 $genres[] = $theme['name'];
663 663
                             }
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 
668 668
                         $platform = '';
669 669
 
670
-                        if (! empty($game->platforms)) {
670
+                        if (!empty($game->platforms)) {
671 671
                             foreach ($game->platforms as $platforms) {
672 672
                                 $percentCurrent = 0;
673 673
                                 $gamePlatforms = Platform::where('id', $platforms)->get();
@@ -686,13 +686,13 @@  discard block
 block discarded – undo
686 686
                             'title' => $game->name,
687 687
                             'asin' => $game->id,
688 688
                             'review' => $game->summary ?? '',
689
-                            'coverurl' => ! empty($game->cover->url) ? 'https:'.$game->cover->url : '',
690
-                            'releasedate' => ! empty($game->first_release_date) ? $game->first_release_date->format('Y-m-d') : now()->format('Y-m-d'),
691
-                            'esrb' => ! empty($game->aggregated_rating) ? round($game->aggregated_rating).'%' : 'Not Rated',
689
+                            'coverurl' => !empty($game->cover->url) ? 'https:'.$game->cover->url : '',
690
+                            'releasedate' => !empty($game->first_release_date) ? $game->first_release_date->format('Y-m-d') : now()->format('Y-m-d'),
691
+                            'esrb' => !empty($game->aggregated_rating) ? round($game->aggregated_rating).'%' : 'Not Rated',
692 692
                             'url' => $game->url ?? '',
693
-                            'publisher' => ! empty($publishers) ? implode(',', $publishers) : 'Unknown',
693
+                            'publisher' => !empty($publishers) ? implode(',', $publishers) : 'Unknown',
694 694
                             'platform' => $platform ?? '',
695
-                            'consolegenre' => ! empty($genres) ? implode(',', $genres) : 'Unknown',
695
+                            'consolegenre' => !empty($genres) ? implode(',', $genres) : 'Unknown',
696 696
                             'consolegenreid' => $genreKey ?? '',
697 697
                             'salesrank' => '',
698 698
                         ];
@@ -835,7 +835,7 @@  discard block
 block discarded – undo
835 835
                 $platform = 'PSX';
836 836
             }
837 837
 
838
-            if (! empty($title) && stripos('XBLA', $platform) === 0 && stripos('dlc', $title) !== false) {
838
+            if (!empty($title) && stripos('XBLA', $platform) === 0 && stripos('dlc', $title) !== false) {
839 839
                 $platform = 'XBOX360';
840 840
             }
841 841
 
@@ -850,7 +850,7 @@  discard block
 block discarded – undo
850 850
            Other option is to pass the $release->categories_id here if we don't find a platform but that
851 851
            would require an extra lookup to determine the name. In either case we should have a title at the minimum. */
852 852
 
853
-        return (isset($result['title'], $result['platform']) && ! empty($result['title'])) ? $result : false;
853
+        return (isset($result['title'], $result['platform']) && !empty($result['title'])) ? $result : false;
854 854
     }
855 855
 
856 856
     public function getBrowseNode($platform): string
Please login to merge, or discard this patch.
Blacklight/processing/Videos.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
Blacklight/XXX.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
 			%s %s %s %s
160 160
 			GROUP BY xxx.id
161 161
 			ORDER BY %s %s",
162
-            (! empty($xxxIDs) ? implode(',', $xxxIDs) : -1),
162
+            (!empty($xxxIDs) ? implode(',', $xxxIDs) : -1),
163 163
             $this->showPasswords,
164 164
             $this->getBrowseBy(),
165 165
             $catSrch,
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
     {
212 212
         $browseBy = ' ';
213 213
         foreach (['title', 'director', 'actors', 'genre', 'id'] as $bb) {
214
-            if (! empty($_REQUEST[$bb])) {
214
+            if (!empty($_REQUEST[$bb])) {
215 215
                 $bbv = stripslashes($_REQUEST[$bb]);
216 216
                 if ($bb === 'genre') {
217 217
                     $bbv = $this->getGenreID($bbv);
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
         string $cover = '',
247 247
         string $backdrop = ''
248 248
     ): void {
249
-        if (! empty($id)) {
249
+        if (!empty($id)) {
250 250
             XxxInfo::query()->where('id', $id)->update(
251 251
                 [
252 252
                     'title' => $title,
@@ -288,12 +288,12 @@  discard block
 block discarded – undo
288 288
     public function getGenres(bool $activeOnly = false, $gid = null): mixed
289 289
     {
290 290
         if ($activeOnly) {
291
-            return Genre::query()->where(['disabled' => 0, 'type' => Category::XXX_ROOT])->when($gid !== null, function ($query) use ($gid) {
291
+            return Genre::query()->where(['disabled' => 0, 'type' => Category::XXX_ROOT])->when($gid !== null, function($query) use ($gid) {
292 292
                 return $query->where('id', $gid);
293 293
             })->orderBy('title')->first(['title']);
294 294
         }
295 295
 
296
-        return Genre::query()->where(['type' => Category::XXX_ROOT])->when($gid !== null, function ($query) use ($gid) {
296
+        return Genre::query()->where(['type' => Category::XXX_ROOT])->when($gid !== null, function($query) use ($gid) {
297 297
             return $query->where('id', $gid);
298 298
         })->orderBy('title')->first(['title']);
299 299
     }
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
     {
309 309
         $ret = null;
310 310
 
311
-        if (! \is_array($arr)) {
311
+        if (!\is_array($arr)) {
312 312
             $res = Genre::query()->where('title', $arr)->first(['id']);
313 313
             if ($res !== null) {
314 314
                 return $res['id'];
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
     public function insertSwf($whichClass, $res): string
349 349
     {
350 350
         $ret = '';
351
-        if (($whichClass === 'ade') && ! empty($res)) {
351
+        if (($whichClass === 'ade') && !empty($res)) {
352 352
             $trailers = unserialize($res, 'ade');
353 353
             $ret .= "<object width='360' height='240' type='application/x-shockwave-flash' id='EmpireFlashPlayer' name='EmpireFlashPlayer' data='".$trailers['url']."'>";
354 354
             $ret .= "<param name='flashvars' value= 'streamID=".$trailers['streamid'].'&amp;autoPlay=false&amp;BaseStreamingUrl='.$trailers['baseurl']."'>";
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
 
357 357
             return $ret;
358 358
         }
359
-        if (($whichClass === 'pop') && ! empty($res)) {
359
+        if (($whichClass === 'pop') && !empty($res)) {
360 360
             $trailers = unserialize($res, 'pop');
361 361
             $ret .= "<embed id='trailer' width='480' height='360'";
362 362
             $ret .= "flashvars='".$trailers['flashvars']."' allowfullscreen='true' allowscriptaccess='always' quality='high' name='trailer' style='undefined'";
@@ -433,22 +433,22 @@  discard block
 block discarded – undo
433 433
             return -2;
434 434
         }
435 435
 
436
-        $res['cast'] = ! empty($res['cast']) ? implode(',', $res['cast']) : '';
437
-        $res['genres'] = ! empty($res['genres']) ? $this->getGenreID($res['genres']) : '';
436
+        $res['cast'] = !empty($res['cast']) ? implode(',', $res['cast']) : '';
437
+        $res['genres'] = !empty($res['genres']) ? $this->getGenreID($res['genres']) : '';
438 438
 
439 439
         $mov = [
440
-            'trailers' => ! empty($res['trailers']) ? serialize($res['trailers']) : '',
441
-            'extras' => ! empty($res['extras']) ? serialize($res['extras']) : '',
442
-            'productinfo' => ! empty($res['productinfo']) ? serialize($res['productinfo']) : '',
443
-            'backdrop' => ! empty($res['backcover']) ? $res['backcover'] : 0,
444
-            'cover' => ! empty($res['boxcover']) ? $res['boxcover'] : 0,
445
-            'title' => ! empty($res['title']) ? html_entity_decode($res['title'], ENT_QUOTES, 'UTF-8') : '',
446
-            'plot' => ! empty($res['synopsis']) ? html_entity_decode($res['synopsis'], ENT_QUOTES, 'UTF-8') : '',
447
-            'tagline' => ! empty($res['tagline']) ? html_entity_decode($res['tagline'], ENT_QUOTES, 'UTF-8') : '',
448
-            'genre' => ! empty($res['genres']) ? html_entity_decode($res['genres'], ENT_QUOTES, 'UTF-8') : '',
449
-            'director' => ! empty($res['director']) ? html_entity_decode($res['director'], ENT_QUOTES, 'UTF-8') : '',
450
-            'actors' => ! empty($res['cast']) ? html_entity_decode($res['cast'], ENT_QUOTES, 'UTF-8') : '',
451
-            'directurl' => ! empty($res['directurl']) ? html_entity_decode($res['directurl'], ENT_QUOTES, 'UTF-8') : '',
440
+            'trailers' => !empty($res['trailers']) ? serialize($res['trailers']) : '',
441
+            'extras' => !empty($res['extras']) ? serialize($res['extras']) : '',
442
+            'productinfo' => !empty($res['productinfo']) ? serialize($res['productinfo']) : '',
443
+            'backdrop' => !empty($res['backcover']) ? $res['backcover'] : 0,
444
+            'cover' => !empty($res['boxcover']) ? $res['boxcover'] : 0,
445
+            'title' => !empty($res['title']) ? html_entity_decode($res['title'], ENT_QUOTES, 'UTF-8') : '',
446
+            'plot' => !empty($res['synopsis']) ? html_entity_decode($res['synopsis'], ENT_QUOTES, 'UTF-8') : '',
447
+            'tagline' => !empty($res['tagline']) ? html_entity_decode($res['tagline'], ENT_QUOTES, 'UTF-8') : '',
448
+            'genre' => !empty($res['genres']) ? html_entity_decode($res['genres'], ENT_QUOTES, 'UTF-8') : '',
449
+            'director' => !empty($res['director']) ? html_entity_decode($res['director'], ENT_QUOTES, 'UTF-8') : '',
450
+            'actors' => !empty($res['cast']) ? html_entity_decode($res['cast'], ENT_QUOTES, 'UTF-8') : '',
451
+            'directurl' => !empty($res['directurl']) ? html_entity_decode($res['directurl'], ENT_QUOTES, 'UTF-8') : '',
452 452
             'classused' => $this->whichClass,
453 453
         ];
454 454
 
@@ -458,12 +458,12 @@  discard block
 block discarded – undo
458 458
             $xxxID = $check['id'];
459 459
 
460 460
             // Update BoxCover.
461
-            if (! empty($mov['cover'])) {
461
+            if (!empty($mov['cover'])) {
462 462
                 $cover = $this->releaseImage->saveImage($xxxID.'-cover', $mov['cover'], $this->imgSavePath);
463 463
             }
464 464
 
465 465
             // BackCover.
466
-            if (! empty($mov['backdrop'])) {
466
+            if (!empty($mov['backdrop'])) {
467 467
                 $backdrop = $this->releaseImage->saveImage($xxxID.'-backdrop', $mov['backdrop'], $this->imgSavePath, 1920, 1024);
468 468
             }
469 469
 
@@ -491,12 +491,12 @@  discard block
 block discarded – undo
491 491
                 ]
492 492
             );
493 493
             // Update BoxCover.
494
-            if (! empty($mov['cover'])) {
494
+            if (!empty($mov['cover'])) {
495 495
                 $cover = $this->releaseImage->saveImage($xxxID.'-cover', $mov['cover'], $this->imgSavePath);
496 496
             }
497 497
 
498 498
             // BackCover.
499
-            if (! empty($mov['backdrop'])) {
499
+            if (!empty($mov['backdrop'])) {
500 500
                 $backdrop = $this->releaseImage->saveImage($xxxID.'-backdrop', $mov['backdrop'], $this->imgSavePath, 1920, 1024);
501 501
             }
502 502
 
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
             $name = trim(preg_replace('/(brazilian|chinese|croatian|danish|deutsch|dutch|estonian|flemish|finnish|french|german|greek|hebrew|icelandic|italian|latin|nordic|norwegian|polish|portuguese|japenese|japanese|russian|serbian|slovenian|spanish|spanisch|swedish|thai|turkish)$/i', '', $name));
610 610
 
611 611
             // Check if the name is long enough and not just numbers and not file (d) of (d) and does not contain Episodes and any dated 00.00.00 which are site rips..
612
-            if (\strlen($name) > 5 && ! preg_match('/^\d+$/', $name) && ! preg_match('/( File \d+ of \d+|\d+.\d+.\d+)/', $name) && ! preg_match('/(E\d+)/', $name) && ! preg_match('/\d\d\.\d\d.\d\d/', $name)) {
612
+            if (\strlen($name) > 5 && !preg_match('/^\d+$/', $name) && !preg_match('/( File \d+ of \d+|\d+.\d+.\d+)/', $name) && !preg_match('/(E\d+)/', $name) && !preg_match('/\d\d\.\d\d.\d\d/', $name)) {
613 613
                 $this->currentTitle = $name;
614 614
 
615 615
                 return true;
Please login to merge, or discard this patch.
Blacklight/IRCClient.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      */
151 151
     public function setSocketTimeout(int $timeout)
152 152
     {
153
-        if (! is_numeric($timeout)) {
153
+        if (!is_numeric($timeout)) {
154 154
             echo 'ERROR: IRC socket timeout must be a number!'.PHP_EOL;
155 155
         } else {
156 156
             $this->_socket_timeout = $timeout;
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
      */
165 165
     public function setConnectionTimeout(int $timeout)
166 166
     {
167
-        if (! is_numeric($timeout)) {
167
+        if (!is_numeric($timeout)) {
168 168
             echo 'ERROR: IRC connection timeout must be a number!'.PHP_EOL;
169 169
         } else {
170 170
             $this->_remote_connection_timeout = $timeout;
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
      */
177 177
     public function setConnectionRetries(int $retries)
178 178
     {
179
-        if (! is_numeric($retries)) {
179
+        if (!is_numeric($retries)) {
180 180
             echo 'ERROR: IRC connection retries must be a number!'.PHP_EOL;
181 181
         } else {
182 182
             $this->_reconnectRetries = $retries;
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
      */
191 191
     public function setReConnectDelay(int $delay)
192 192
     {
193
-        if (! is_numeric($delay)) {
193
+        if (!is_numeric($delay)) {
194 194
             echo 'ERROR: IRC reconnect delay must be a number!'.PHP_EOL;
195 195
         } else {
196 196
             $this->_reconnectDelay = $delay;
@@ -210,14 +210,14 @@  discard block
 block discarded – undo
210 210
         $transport = ($tls === true ? 'tls' : 'tcp');
211 211
 
212 212
         $socket_string = $transport.'://'.$hostname.':'.$port;
213
-        if ($socket_string !== $this->_remote_socket_string || ! $this->_connected()) {
214
-            if (! \is_string($hostname) || $hostname === '') {
213
+        if ($socket_string !== $this->_remote_socket_string || !$this->_connected()) {
214
+            if (!\is_string($hostname) || $hostname === '') {
215 215
                 echo 'ERROR: IRC host name must not be empty!'.PHP_EOL;
216 216
 
217 217
                 return false;
218 218
             }
219 219
 
220
-            if (! is_numeric($port)) {
220
+            if (!is_numeric($port)) {
221 221
                 echo 'ERROR: IRC port must be a number!'.PHP_EOL;
222 222
 
223 223
                 return false;
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
      */
262 262
     public function login(string $nickName, string $userName, string $realName, $password = null): bool
263 263
     {
264
-        if (! $this->_connected()) {
264
+        if (!$this->_connected()) {
265 265
             echo 'ERROR: You must connect to IRC first!'.PHP_EOL;
266 266
 
267 267
             return false;
@@ -278,15 +278,15 @@  discard block
 block discarded – undo
278 278
         $this->_realName = $realName;
279 279
         $this->_password = $password;
280 280
 
281
-        if (($password !== null && ! empty($password)) && ! $this->_writeSocket('PASSWORD '.$password)) {
281
+        if (($password !== null && !empty($password)) && !$this->_writeSocket('PASSWORD '.$password)) {
282 282
             return false;
283 283
         }
284 284
 
285
-        if (! $this->_writeSocket('NICK '.$nickName)) {
285
+        if (!$this->_writeSocket('NICK '.$nickName)) {
286 286
             return false;
287 287
         }
288 288
 
289
-        if (! $this->_writeSocket('USER '.$userName.' 0 * :'.$realName)) {
289
+        if (!$this->_writeSocket('USER '.$userName.' 0 * :'.$realName)) {
290 290
             return false;
291 291
         }
292 292
 
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
                         $tempPass = $password;
316 316
                     }
317 317
 
318
-                    if ($password !== null && ! $this->_writeSocket('PASS '.$tempPass)) {
318
+                    if ($password !== null && !$this->_writeSocket('PASS '.$tempPass)) {
319 319
                         return false;
320 320
                     }
321 321
 
@@ -399,13 +399,13 @@  discard block
 block discarded – undo
399 399
     {
400 400
         $this->_channels = $channels;
401 401
 
402
-        if (! $this->_connected()) {
402
+        if (!$this->_connected()) {
403 403
             echo 'ERROR: You must connect to IRC first!'.PHP_EOL;
404 404
 
405 405
             return false;
406 406
         }
407 407
 
408
-        if (! empty($channels)) {
408
+        if (!empty($channels)) {
409 409
             foreach ($channels as $channel => $password) {
410 410
                 $this->_joinChannel($channel, $password ?? '');
411 411
             }
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
         $pong = $this->_writeSocket('PING '.$host);
454 454
 
455 455
         // Check if there's a connection error.
456
-        if ($pong === false || ((time() - $this->_lastPing) > ($this->_socket_timeout / 2) && ! 0 === strpos($this->_buffer, 'PONG'))) {
456
+        if ($pong === false || ((time() - $this->_lastPing) > ($this->_socket_timeout / 2) && !0 === strpos($this->_buffer, 'PONG'))) {
457 457
             $this->_reconnect();
458 458
         }
459 459
 
@@ -468,12 +468,12 @@  discard block
 block discarded – undo
468 468
      */
469 469
     protected function _reconnect()
470 470
     {
471
-        if (! $this->connect($this->_remote_host, $this->_remote_port, $this->_remote_tls)) {
471
+        if (!$this->connect($this->_remote_host, $this->_remote_port, $this->_remote_tls)) {
472 472
             exit('FATAL: Could not reconnect to ('.$this->_remote_host.') after ('.$this->_reconnectRetries.') tries.'.PHP_EOL);
473 473
         }
474 474
 
475 475
         if ($this->_alreadyLoggedIn === false) {
476
-            if (! $this->login($this->_nickName, $this->_userName, $this->_realName, $this->_password)) {
476
+            if (!$this->login($this->_nickName, $this->_userName, $this->_realName, $this->_password)) {
477 477
                 exit('FATAL: Could not log in to ('.$this->_remote_host.')!'.PHP_EOL);
478 478
             }
479 479
 
@@ -490,7 +490,7 @@  discard block
 block discarded – undo
490 490
         do {
491 491
             stream_set_timeout($this->_socket, $this->_socket_timeout);
492 492
             $buffer .= fgets($this->_socket, 1024);
493
-        } while (! empty($buffer) && ! preg_match('/\v+$/', $buffer));
493
+        } while (!empty($buffer) && !preg_match('/\v+$/', $buffer));
494 494
         $this->_buffer = trim($buffer);
495 495
 
496 496
         if ($this->_debug && $this->_buffer !== '') {
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
      */
577 577
     protected function _connected(): bool
578 578
     {
579
-        return \is_resource($this->_socket) && ! feof($this->_socket);
579
+        return \is_resource($this->_socket) && !feof($this->_socket);
580 580
     }
581 581
 
582 582
     /**
Please login to merge, or discard this patch.