Passed
Push — master ( 95d1de...1bc794 )
by Darko
19:58
created
Blacklight/processing/tv/TVDB.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
                 }
130 130
 
131 131
                 if ((int) $videoId > 0 && (int) $tvDbId > 0) {
132
-                    if (! empty($tvdbShow['poster'])) { // Use TVDB poster if available
132
+                    if (!empty($tvdbShow['poster'])) { // Use TVDB poster if available
133 133
                         $this->getPoster($videoId);
134 134
                     } else { // Check Fanart.tv for poster
135 135
                         $poster = $this->fanart->getTVFanArt($tvDbId);
@@ -139,8 +139,8 @@  discard block
 block discarded – undo
139 139
                         }
140 140
                     }
141 141
 
142
-                    $seasonNo = (! empty($release['season']) ? preg_replace('/^S0*/i', '', $release['season']) : '');
143
-                    $episodeNo = (! empty($release['episode']) ? preg_replace('/^E0*/i', '', $release['episode']) : '');
142
+                    $seasonNo = (!empty($release['season']) ? preg_replace('/^S0*/i', '', $release['season']) : '');
143
+                    $episodeNo = (!empty($release['episode']) ? preg_replace('/^E0*/i', '', $release['episode']) : '');
144 144
 
145 145
                     if ($episodeNo === 'all') {
146 146
                         // Set the video ID and leave episode 0
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                     }
152 152
 
153 153
                     // Download all episodes if new show to reduce API/bandwidth usage
154
-                    if (! $this->countEpsByVideoID($videoId)) {
154
+                    if (!$this->countEpsByVideoID($videoId)) {
155 155
                         $this->getEpisodeInfo($tvDbId, -1, -1, $videoId);
156 156
                     }
157 157
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
                     }
252 252
 
253 253
                     // Check for show aliases and try match those too
254
-                    if (! empty($show->aliases)) {
254
+                    if (!empty($show->aliases)) {
255 255
                         foreach ($show->aliases as $key => $name) {
256 256
                             $matchPercent = $this->checkMatch(strtolower($name), strtolower($name), $matchPercent);
257 257
                             if ($matchPercent > $highestMatch) {
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                     }
263 263
                 }
264 264
             }
265
-            if (! empty($highest)) {
265
+            if (!empty($highest)) {
266 266
                 $return = $this->formatShowInfo($highest);
267 267
             }
268 268
         }
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     {
299 299
         $return = $response = false;
300 300
 
301
-        if (! $this->local) {
301
+        if (!$this->local) {
302 302
             if ($videoId > 0) {
303 303
                 try {
304 304
                     $response = $this->client->series()->allEpisodes($tvDbId);
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
             $poster = $this->client->series()->artworks($show->tvdb_id);
357 357
             // Grab the image with the highest score where type == 2
358 358
             $poster = collect($poster)->where('type', 2)->sortByDesc('score')->first();
359
-            $this->posterUrl = ! empty($poster->image) ? $poster->image : '';
359
+            $this->posterUrl = !empty($poster->image) ? $poster->image : '';
360 360
         } catch (ResourceNotFoundException $e) {
361 361
             $this->colorCli->climate()->error('Poster image not found on TVDB');
362 362
         } catch (UnauthorizedException $error) {
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
             'tvrage' => 0,
397 397
             'tvmaze' => 0,
398 398
             'tmdb' => 0,
399
-            'aliases' => ! empty($show->aliases) ? $show->aliases : '',
399
+            'aliases' => !empty($show->aliases) ? $show->aliases : '',
400 400
             'localzone' => "''",
401 401
         ];
402 402
     }
Please login to merge, or discard this patch.
Blacklight/Releases.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 				GROUP BY r.id
276 276
 				ORDER BY %s %s %s",
277 277
             $this->uSQL($userShows, 'videos_id'),
278
-            (! empty($excludedCats) ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''),
278
+            (!empty($excludedCats) ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''),
279 279
             NZB::NZB_ADDED,
280 280
             Category::TV_ROOT,
281 281
             Category::TV_OTHER,
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
     {
346 346
         // Delete NZB from disk.
347 347
         $nzbPath = $nzb->NZBPath($identifiers['g']);
348
-        if (! empty($nzbPath)) {
348
+        if (!empty($nzbPath)) {
349 349
             File::delete($nzbPath);
350 350
         }
351 351
 
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
      */
386 386
     public function updateMulti($guids, $category, $grabs, $videoId, $episodeId, $anidbId, $imdbId)
387 387
     {
388
-        if (! \is_array($guids) || \count($guids) < 1) {
388
+        if (!\is_array($guids) || \count($guids) < 1) {
389 389
             return false;
390 390
         }
391 391
 
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
         $sql = '(1=2 ';
410 410
         foreach ($userQuery as $query) {
411 411
             $sql .= sprintf('OR (r.%s = %d', $type, $query->$type);
412
-            if (! empty($query->categories)) {
412
+            if (!empty($query->categories)) {
413 413
                 $catsArr = explode('|', $query->categories);
414 414
                 if (\count($catsArr) > 1) {
415 415
                     $sql .= sprintf(' AND r.categories_id IN (%s)', implode(',', $catsArr));
@@ -453,7 +453,7 @@  discard block
 block discarded – undo
453 453
             $orderBy = $this->getBrowseOrder($orderBy);
454 454
         }
455 455
 
456
-        $searchFields = Arr::where($searchArr, static function ($value) {
456
+        $searchFields = Arr::where($searchArr, static function($value) {
457 457
             return $value !== -1;
458 458
         });
459 459
 
@@ -463,7 +463,7 @@  discard block
 block discarded – undo
463 463
             $searchResult = $this->elasticSearch->indexSearch($phrases, $limit);
464 464
         } else {
465 465
             $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', '', [], $searchFields);
466
-            if (! empty($searchResult)) {
466
+            if (!empty($searchResult)) {
467 467
                 $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
468 468
             }
469 469
         }
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
                 $searchResult = $this->elasticSearch->indexSearchApi($searchName, $limit);
555 555
             } else {
556 556
                 $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $searchName, ['searchname']);
557
-                if (! empty($searchResult)) {
557
+                if (!empty($searchResult)) {
558 558
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
559 559
                 }
560 560
             }
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
             ((int) $groupName !== -1 ? sprintf(' AND r.groups_id = %d ', UsenetGroup::getIDByName($groupName)) : ''),
571 571
             $catQuery,
572 572
             (\count($excludedCats) > 0 ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''),
573
-            (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
573
+            (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
574 574
             ($minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : '')
575 575
         );
576 576
         $baseSql = sprintf(
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
         if ($releases !== null) {
605 605
             return $releases;
606 606
         }
607
-        if ($searchName !== -1 && ! empty($searchResult)) {
607
+        if ($searchName !== -1 && !empty($searchResult)) {
608 608
             $releases = self::fromQuery($sql);
609 609
         } elseif ($searchName !== -1 && empty($searchResult)) {
610 610
             $releases = collect();
@@ -658,11 +658,11 @@  discard block
 block discarded – undo
658 658
             $show = self::fromQuery($showQry);
659 659
 
660 660
             if ($show->isNotEmpty()) {
661
-                if ((! empty($episode) && ! empty($series)) && $show[0]->episodes !== '') {
661
+                if ((!empty($episode) && !empty($series)) && $show[0]->episodes !== '') {
662 662
                     $showSql .= ' AND r.tv_episodes_id IN ('.$show[0]->episodes.') AND tve.series = '.$series;
663
-                } elseif (! empty($episode) && $show[0]->episodes !== '') {
663
+                } elseif (!empty($episode) && $show[0]->episodes !== '') {
664 664
                     $showSql = sprintf('AND r.tv_episodes_id IN (%s)', $show[0]->episodes);
665
-                } elseif (! empty($series) && empty($episode)) {
665
+                } elseif (!empty($series) && empty($episode)) {
666 666
                     // If $series is set but episode is not, return Season Packs and Episodes
667 667
                     $showSql .= ' AND r.tv_episodes_id IN ('.$show[0]->episodes.') AND tve.series = '.$series;
668 668
                 }
@@ -676,26 +676,26 @@  discard block
 block discarded – undo
676 676
         }
677 677
 
678 678
         // If $name is set it is a fallback search, add available SxxExx/airdate info to the query
679
-        if (! empty($name) && $showSql === '') {
680
-            if (! empty($series) && (int) $series < 1900) {
679
+        if (!empty($name) && $showSql === '') {
680
+            if (!empty($series) && (int) $series < 1900) {
681 681
                 $name .= sprintf(' S%s', str_pad($series, 2, '0', STR_PAD_LEFT));
682
-                if (! empty($episode) && ! str_contains($episode, '/')) {
682
+                if (!empty($episode) && !str_contains($episode, '/')) {
683 683
                     $name .= sprintf('E%s', str_pad($episode, 2, '0', STR_PAD_LEFT));
684 684
                 }
685 685
                 // If season is not empty but episode is, add a wildcard to the search
686 686
                 if (empty($episode)) {
687 687
                     $name .= '*';
688 688
                 }
689
-            } elseif (! empty($airDate)) {
689
+            } elseif (!empty($airDate)) {
690 690
                 $name .= sprintf(' %s', str_replace(['/', '-', '.', '_'], ' ', $airDate));
691 691
             }
692 692
         }
693
-        if (! empty($name)) {
693
+        if (!empty($name)) {
694 694
             if (config('nntmux.elasticsearch_enabled') === true) {
695 695
                 $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit);
696 696
             } else {
697 697
                 $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']);
698
-                if (! empty($searchResult)) {
698
+                if (!empty($searchResult)) {
699 699
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
700 700
                 }
701 701
             }
@@ -711,11 +711,11 @@  discard block
 block discarded – undo
711 711
             NZB::NZB_ADDED,
712 712
             $this->showPasswords(),
713 713
             $showSql,
714
-            (! empty($name) && ! empty($searchResult)) ? 'AND r.id IN ('.implode(',', $searchResult).')' : '',
714
+            (!empty($name) && !empty($searchResult)) ? 'AND r.id IN ('.implode(',', $searchResult).')' : '',
715 715
             Category::getCategorySearch($cat),
716 716
             $maxAge > 0 ? sprintf('AND r.postdate > NOW() - INTERVAL %d DAY', $maxAge) : '',
717 717
             $minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : '',
718
-            ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : ''
718
+            !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : ''
719 719
         );
720 720
         $baseSql = sprintf(
721 721
             "SELECT r.searchname, r.guid, r.postdate, r.groups_id, r.categories_id, r.size, r.totalpart, r.fromname, r.passwordstatus, r.grabs, r.comments, r.adddate, r.videos_id, r.tv_episodes_id, r.haspreview, r.jpgstatus,
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
         if ($releases !== null) {
752 752
             return $releases;
753 753
         }
754
-        $releases = ((! empty($name) && ! empty($searchResult)) || empty($name)) ? self::fromQuery($sql) : [];
754
+        $releases = ((!empty($name) && !empty($searchResult)) || empty($name)) ? self::fromQuery($sql) : [];
755 755
         if (count($releases) !== 0 && $releases->isNotEmpty()) {
756 756
             $releases[0]->_totalrows = $this->getPagerCount(
757 757
                 preg_replace('#LEFT(\s+OUTER)?\s+JOIN\s+(?!tv_episodes)\s+.*ON.*=.*\n#i', ' ', $baseSql)
@@ -799,11 +799,11 @@  discard block
 block discarded – undo
799 799
 
800 800
             $show = self::fromQuery($showQry);
801 801
             if ($show->isNotEmpty()) {
802
-                if ((! empty($episode) && ! empty($series)) && $show[0]->episodes !== '') {
802
+                if ((!empty($episode) && !empty($series)) && $show[0]->episodes !== '') {
803 803
                     $showSql .= ' AND r.tv_episodes_id IN ('.$show[0]->episodes.') AND tve.series = '.$series;
804
-                } elseif (! empty($episode) && $show[0]->episodes !== '') {
804
+                } elseif (!empty($episode) && $show[0]->episodes !== '') {
805 805
                     $showSql = sprintf('AND r.tv_episodes_id IN (%s)', $show[0]->episodes);
806
-                } elseif (! empty($series) && empty($episode)) {
806
+                } elseif (!empty($series) && empty($episode)) {
807 807
                     // If $series is set but episode is not, return Season Packs and Episodes
808 808
                     $showSql .= ' AND r.tv_episodes_id IN ('.$show[0]->episodes.') AND tve.series = '.$series;
809 809
                 }
@@ -816,26 +816,26 @@  discard block
 block discarded – undo
816 816
             }
817 817
         }
818 818
         // If $name is set it is a fallback search, add available SxxExx/airdate info to the query
819
-        if (! empty($name) && $showSql === '') {
820
-            if (! empty($series) && (int) $series < 1900) {
819
+        if (!empty($name) && $showSql === '') {
820
+            if (!empty($series) && (int) $series < 1900) {
821 821
                 $name .= sprintf(' S%s', str_pad($series, 2, '0', STR_PAD_LEFT));
822
-                if (! empty($episode) && ! str_contains($episode, '/')) {
822
+                if (!empty($episode) && !str_contains($episode, '/')) {
823 823
                     $name .= sprintf('E%s', str_pad($episode, 2, '0', STR_PAD_LEFT));
824 824
                 }
825 825
                 // If season is not empty but episode is, add a wildcard to the search
826 826
                 if (empty($episode)) {
827 827
                     $name .= '*';
828 828
                 }
829
-            } elseif (! empty($airDate)) {
829
+            } elseif (!empty($airDate)) {
830 830
                 $name .= sprintf(' %s', str_replace(['/', '-', '.', '_'], ' ', $airDate));
831 831
             }
832 832
         }
833
-        if (! empty($name)) {
833
+        if (!empty($name)) {
834 834
             if (config('nntmux.elasticsearch_enabled') === true) {
835 835
                 $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit);
836 836
             } else {
837 837
                 $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']);
838
-                if (! empty($searchResult)) {
838
+                if (!empty($searchResult)) {
839 839
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
840 840
                 }
841 841
             }
@@ -851,11 +851,11 @@  discard block
 block discarded – undo
851 851
             NZB::NZB_ADDED,
852 852
             $this->showPasswords(),
853 853
             $showSql,
854
-            (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
854
+            (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
855 855
             Category::getCategorySearch($cat),
856 856
             ($maxAge > 0 ? sprintf('AND r.postdate > NOW() - INTERVAL %d DAY', $maxAge) : ''),
857 857
             ($minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : ''),
858
-            ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : ''
858
+            !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : ''
859 859
         );
860 860
         $baseSql = sprintf(
861 861
             "SELECT r.searchname, r.guid, r.postdate, r.groups_id, r.categories_id, r.size, r.totalpart, r.fromname, r.passwordstatus, r.grabs, r.comments, r.adddate, r.tv_episodes_id, r.haspreview, r.jpgstatus,
@@ -905,12 +905,12 @@  discard block
 block discarded – undo
905 905
      */
906 906
     public function animeSearch($aniDbID, int $offset = 0, int $limit = 100, string $name = '', array $cat = [-1], int $maxAge = -1, array $excludedCategories = []): mixed
907 907
     {
908
-        if (! empty($name)) {
908
+        if (!empty($name)) {
909 909
             if (config('nntmux.elasticsearch_enabled') === true) {
910 910
                 $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit);
911 911
             } else {
912 912
                 $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']);
913
-                if (! empty($searchResult)) {
913
+                if (!empty($searchResult)) {
914 914
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
915 915
                 }
916 916
             }
@@ -927,8 +927,8 @@  discard block
 block discarded – undo
927 927
             $this->showPasswords(),
928 928
             NZB::NZB_ADDED,
929 929
             ($aniDbID > -1 ? sprintf(' AND r.anidbid = %d ', $aniDbID) : ''),
930
-            (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
931
-            ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '',
930
+            (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
931
+            !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '',
932 932
             Category::getCategorySearch($cat),
933 933
             ($maxAge > 0 ? sprintf(' AND r.postdate > NOW() - INTERVAL %d DAY ', $maxAge) : '')
934 934
         );
@@ -975,12 +975,12 @@  discard block
 block discarded – undo
975 975
      */
976 976
     public function moviesSearch(int $imDbId = -1, int $tmDbId = -1, int $traktId = -1, int $offset = 0, int $limit = 100, string $name = '', array $cat = [-1], int $maxAge = -1, int $minSize = 0, array $excludedCategories = []): mixed
977 977
     {
978
-        if (! empty($name)) {
978
+        if (!empty($name)) {
979 979
             if (config('nntmux.elasticsearch_enabled') === true) {
980 980
                 $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit);
981 981
             } else {
982 982
                 $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']);
983
-                if (! empty($searchResult)) {
983
+                if (!empty($searchResult)) {
984 984
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
985 985
                 }
986 986
             }
@@ -997,11 +997,11 @@  discard block
 block discarded – undo
997 997
 			%s %s %s %s %s %s %s',
998 998
             NZB::NZB_ADDED,
999 999
             $this->showPasswords(),
1000
-            (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
1000
+            (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
1001 1001
             ($imDbId !== -1 && is_numeric($imDbId)) ? sprintf(' AND m.imdbid = \'%s\' ', $imDbId) : '',
1002 1002
             ($tmDbId !== -1 && is_numeric($tmDbId)) ? sprintf(' AND m.tmdbid = %d ', $tmDbId) : '',
1003 1003
             ($traktId !== -1 && is_numeric($traktId)) ? sprintf(' AND m.traktid = %d ', $traktId) : '',
1004
-            ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '',
1004
+            !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '',
1005 1005
             Category::getCategorySearch($cat),
1006 1006
             $maxAge > 0 ? sprintf(' AND r.postdate > NOW() - INTERVAL %d DAY ', $maxAge) : '',
1007 1007
             $minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : ''
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
             $parentCat = $catRow['root_categories_id'];
1054 1054
 
1055 1055
             $results = $this->search(['searchname' => getSimilarName($name)], -1, '', '', -1, -1, 0, config('nntmux.items_per_page'), '', -1, $excludedCats, 'basic', [$parentCat]);
1056
-            if (! $results) {
1056
+            if (!$results) {
1057 1057
                 return $ret;
1058 1058
             }
1059 1059
 
Please login to merge, or discard this patch.
app/Models/Settings.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
         // If there's an override and no mutator has been explicitly defined on
122 122
         // the model then use the override value
123
-        if ($override && ! $this->hasGetMutator($key)) {
123
+        if ($override && !$this->hasGetMutator($key)) {
124 124
             return $override->value;
125 125
         }
126 126
 
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
         $results = self::cursor()->remember();
142 142
 
143 143
         $tree = [];
144
-        if (! empty($results)) {
144
+        if (!empty($results)) {
145 145
             foreach ($results as $result) {
146
-                if (! $excludeUnsectioned || ! empty($result->section)) {
146
+                if (!$excludeUnsectioned || !empty($result->section)) {
147 147
                     $tree[$result->section][$result->subsection][$result->name] =
148 148
                         ['value' => $result->value, 'hint' => $result->hint];
149 149
                 }
Please login to merge, or discard this patch.
misc/testing/Dev/clean_nzbs.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@  discard block
 block discarded – undo
14 14
 $dir = resource_path().'/movednzbs/';
15 15
 $colorCli = new ColorCLI;
16 16
 
17
-if (! isset($argv[1]) || ! in_array($argv[1], ['true', 'move'])) {
17
+if (!isset($argv[1]) || !in_array($argv[1], ['true', 'move'])) {
18 18
     $colorCli->error("This script can remove all nzbs not found in the db and all releases with no nzbs found. It can also move invalid nzbs.\n\n"
19 19
         ."php $argv[0] true     ...: For a dry run, to see how many would be moved.\n"
20 20
         ."php $argv[0] move     ...: Move NZBs that are possibly bad or have no release. They are moved into this folder: $dir");
21 21
     exit();
22 22
 }
23 23
 
24
-if (! File::isDirectory($dir) && ! File::makeDirectory($dir)) {
24
+if (!File::isDirectory($dir) && !File::makeDirectory($dir)) {
25 25
     exit("ERROR: Could not create folder [$dir].".PHP_EOL);
26 26
 }
27 27
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     if (File::isFile($filePath) && $guid) {
45 45
         $nzbfile = Utility::unzipGzipFile($filePath);
46 46
         $nzbContents = $nzb->nzbFileList($nzbfile, ['no-file-key' => false, 'strip-count' => true]);
47
-        if (! $nzbfile || ! @simplexml_load_string($nzbfile) || count($nzbContents) === 0) {
47
+        if (!$nzbfile || !@simplexml_load_string($nzbfile) || count($nzbContents) === 0) {
48 48
             if ($argv[1] === 'move') {
49 49
                 rename($filePath, $dir.$guid.'.nzb.gz');
50 50
             }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 $res = Release::query()->select(['id', 'guid', 'nzbstatus'])->get();
66 66
 foreach ($res as $row) {
67 67
     $nzbpath = $nzb->getNZBPath($row->guid);
68
-    if (! File::isFile($nzbpath)) {
68
+    if (!File::isFile($nzbpath)) {
69 69
         $deleted++;
70 70
         $releases->deleteSingle(['g' => $row->guid, 'i' => $row->id], $nzb, $releaseImage);
71 71
     } elseif ($row->nzbstatus !== 1) {
Please login to merge, or discard this patch.
misc/testing/Releases/recategorize.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 $colorCli = new ColorCLI;
12 12
 
13
-if (! (isset($argv[1]) && ($argv[1] === 'all' || $argv[1] === 'misc' || preg_match('/\([\d, ]+\)/', $argv[1]) || is_numeric($argv[1])))) {
13
+if (!(isset($argv[1]) && ($argv[1] === 'all' || $argv[1] === 'misc' || preg_match('/\([\d, ]+\)/', $argv[1]) || is_numeric($argv[1])))) {
14 14
     $colorCli->error(
15 15
         "\nThis script will attempt to re-categorize releases and is useful if changes have been made to Category.php.\n"
16 16
         ."No updates will be done unless the category changes\n"
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     $timeStart = now();
41 41
     $chgCount = categorizeRelease($argv, true);
42 42
     $time = now()->diffInSeconds($timeStart, true);
43
-    if (! isset($argv[2])) {
43
+    if (!isset($argv[2])) {
44 44
         $colorCli->header('Finished re-categorizing '.number_format($chgCount).' releases in '.$time.' seconds, using the searchname.').PHP_EOL;
45 45
     } else {
46 46
         $colorCli->header('Finished re-categorizing in '.$time.' seconds , using the searchname.'.PHP_EOL
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     $consoleTools = new ConsoleTools;
69 69
     $relCount = $chgCount = 0;
70 70
     if ($total > 0) {
71
-        $query->chunk('100', function ($results) use ($update, $relCount, $chgCount) {
71
+        $query->chunk('100', function($results) use ($update, $relCount, $chgCount) {
72 72
             $cat = new Categorize;
73 73
             foreach ($results as $result) {
74 74
                 $catId = $cat->determineCategory($result->groups_id, $result->searchname, $result->fromname);
Please login to merge, or discard this patch.
misc/testing/Tests/test_trakt_API.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 $c = new Blacklight\ColorCLI;
8 8
 $trakt = new TraktTv;
9 9
 
10
-if (! empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) {
10
+if (!empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) {
11 11
     // Test if your Trakt API key and configuration are working
12 12
     // If it works you should get a printed array of the show/season/episode entered
13 13
 
Please login to merge, or discard this patch.
misc/testing/Tests/test_omdb_API.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 $omdb = new OMDbAPI(config('nntmux_api.omdb_api_key'));
9 9
 $colorCli = new ColorCLI;
10 10
 
11
-if (! empty($argv[1]) && ! empty($argv[2]) && ($argv[2] !== 'series' || $argv[2] !== 'movie')) {
11
+if (!empty($argv[1]) && !empty($argv[2]) && ($argv[2] !== 'series' || $argv[2] !== 'movie')) {
12 12
     // Test if your OMDb API key and configuration are working
13 13
     // If it works you should get a printed array of the show entered
14 14
 
Please login to merge, or discard this patch.
misc/testing/Tests/test_fanarttv_API.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 $fanart = new FanartTV(config('nntmux_api.fanarttv_api_key'));
9 9
 $colorCli = new ColorCLI;
10 10
 
11
-if (! empty($argv[1])) {
11
+if (!empty($argv[1])) {
12 12
     // Test if you can fetch Fanart.TV images
13 13
 
14 14
     // Search for a movie/tv
Please login to merge, or discard this patch.
misc/testing/Tests/test_tvmaze_API.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 $c = new Blacklight\ColorCLI;
8 8
 $tvmaze = new TVMaze;
9 9
 
10
-if (! empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) {
10
+if (!empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) {
11 11
     // Test if your TVMaze API configuration is working
12 12
     // If it works you should get a var dumped array of the show/season/episode entered
13 13
 
Please login to merge, or discard this patch.