Passed
Push — master ( 82f66a...9d3bdd )
by Darko
05:59
created
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.
misc/testing/Tests/test_tmdb_API.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 
8 8
 $colorCli = new ColorCLI;
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 TMDB API configuration is working
12 12
     // If it works you should get a var dumped array of the show/season/episode entered
13 13
 
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     print_r($series);
20 20
 
21 21
     // Use the first show found (highest match) and get the requested season/episode from $argv
22
-    if (! empty($series) && $series['total_results'] > 0) {
22
+    if (!empty($series) && $series['total_results'] > 0) {
23 23
         $seriesAppends = [
24 24
             'networks' => Tmdb::getTvApi()->getTvshow($series['results'][0]['id'])['networks'],
25 25
             'alternative_titles' => Tmdb::getTvApi()->getAlternativeTitles($series['results'][0]['id']),
Please login to merge, or discard this patch.
misc/testing/Tests/test_tvdb_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
 $tvDB = new TVDB;
9 9
 
10
-if (! empty($argv[1]) && isset($argv[2], $argv[3]) && is_numeric($argv[2]) && is_numeric($argv[3])) {
10
+if (!empty($argv[1]) && isset($argv[2], $argv[3]) && is_numeric($argv[2]) && is_numeric($argv[3])) {
11 11
     // Test if your TvDB API key and configuration are 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.
misc/update/tmux/bin/groupfixrelnames.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 use Illuminate\Support\Facades\DB;
17 17
 
18 18
 $colorCli = new ColorCLI;
19
-if (! isset($argv[1])) {
19
+if (!isset($argv[1])) {
20 20
     $colorCli->error('This script is not intended to be run manually, it is called from Multiprocessing.');
21 21
     exit();
22 22
 }
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
                 if (preg_match('/[a-fA-F0-9]{32,40}/i', $release->name, $hits)) {
89 89
                     $nameFixer->matchPredbHash($hits[0], $release, true, 1, true);
90 90
                 }
91
-                if ($nameFixer->matched === false && ! empty($release->filehash) && preg_match('/[a-fA-F0-9]{32,40}/i', $release->filehash, $hits)) {
91
+                if ($nameFixer->matched === false && !empty($release->filehash) && preg_match('/[a-fA-F0-9]{32,40}/i', $release->filehash, $hits)) {
92 92
                     $colorCli->primaryOver('h');
93 93
                     $nameFixer->matchPredbHash($hits[0], $release, true, 1, true);
94 94
                 }
@@ -99,12 +99,12 @@  discard block
 block discarded – undo
99 99
             }
100 100
             $nameFixer->reset();
101 101
 
102
-            if ((int) $release->proc_uid === NameFixer::PROC_UID_NONE && (! empty($release->uid) || ! empty($release->mediainfo))) {
102
+            if ((int) $release->proc_uid === NameFixer::PROC_UID_NONE && (!empty($release->uid) || !empty($release->mediainfo))) {
103 103
                 $colorCli->primaryOver('U');
104
-                if (! empty($release->uid)) {
104
+                if (!empty($release->uid)) {
105 105
                     $nameFixer->checkName($release, true, 'UID, ', 1, true);
106 106
                 }
107
-                if (empty($nameFixer->matched) && ! empty($release->mediainfo)) {
107
+                if (empty($nameFixer->matched) && !empty($release->mediainfo)) {
108 108
                     $nameFixer->checkName($release, true, 'Mediainfo, ', 1, true);
109 109
                 }
110 110
             }
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
             }
117 117
             $nameFixer->reset();
118 118
 
119
-            if ((int) $release->proc_crc32 === NameFixer::PROC_CRC_NONE && ! empty($release->crc)) {
119
+            if ((int) $release->proc_crc32 === NameFixer::PROC_CRC_NONE && !empty($release->crc)) {
120 120
                 $colorCli->primaryOver('C');
121 121
                 $nameFixer->checkName($release, true, 'CRC32, ', 1, true);
122 122
             }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
             }
141 141
             $nameFixer->reset();
142 142
 
143
-            if ((int) $release->proc_hash16k === NameFixer::PROC_HASH16K_NONE && ! empty($release->hash)) {
143
+            if ((int) $release->proc_hash16k === NameFixer::PROC_HASH16K_NONE && !empty($release->hash)) {
144 144
                 $colorCli->primaryOver('H');
145 145
                 $nameFixer->checkName($release, true, 'PAR2 hash, ', 1, true);
146 146
             }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
             }
153 153
             $nameFixer->reset();
154 154
 
155
-            if ((int) $release->nfostatus === Nfo::NFO_FOUND && (int) $release->proc_nfo === NameFixer::PROC_NFO_NONE && ! empty($release->textstring) && ! preg_match('/^=newz\[NZB\]=\w+/', $release->textstring)) {
155
+            if ((int) $release->nfostatus === Nfo::NFO_FOUND && (int) $release->proc_nfo === NameFixer::PROC_NFO_NONE && !empty($release->textstring) && !preg_match('/^=newz\[NZB\]=\w+/', $release->textstring)) {
156 156
                 $colorCli->primaryOver('n');
157 157
                 $nameFixer->done = $nameFixer->matched = false;
158 158
                 $nameFixer->checkName($release, true, 'NFO, ', 1, true);
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
             if ((int) $release->proc_par2 === NameFixer::PROC_PAR2_NONE) {
192 192
                 $colorCli->primaryOver('p');
193
-                if (! isset($nzbcontents)) {
193
+                if (!isset($nzbcontents)) {
194 194
                     $nntp = new NNTP;
195 195
                     if (((int) Settings::settingValue('..alternate_nntp') === 1 ? $nntp->doConnect(true, true) : $nntp->doConnect()) !== true) {
196 196
                         $colorCli->error('Unable to connect to usenet.');
Please login to merge, or discard this patch.