Passed
Pull Request — master (#1628)
by Darko
06:31
created
Blacklight/ReleaseRemover.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
                 $this->colorCLI->header('Removing '.($type === '' ? 'All crap releases ' : $type.' crap releases').' - no time limit.', true);
155 155
             }
156 156
         } else {
157
-            if (! is_numeric($time)) {
157
+            if (!is_numeric($time)) {
158 158
                 $this->error = 'Error, time must be a number or full.';
159 159
 
160 160
                 return $this->returnError();
@@ -630,7 +630,7 @@  discard block
 block discarded – undo
630 630
     {
631 631
         $status = sprintf('AND status = %d', Binaries::BLACKLIST_ENABLED);
632 632
 
633
-        if (! empty($this->blacklistID) && $this->delete === false) {
633
+        if (!empty($this->blacklistID) && $this->delete === false) {
634 634
             $status = '';
635 635
         }
636 636
 
@@ -727,7 +727,7 @@  discard block
 block discarded – undo
727 727
                         $searchResult = (new ElasticSearchSiteSearch)->indexSearch($regexMatch, 100);
728 728
                     } else {
729 729
                         $searchResult = (new ManticoreSearch)->searchIndexes('releases_rt', $regexMatch, ['name,searchname']);
730
-                        if (! empty($searchResult)) {
730
+                        if (!empty($searchResult)) {
731 731
                             $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
732 732
                         }
733 733
                     }
@@ -741,7 +741,7 @@  discard block
 block discarded – undo
741 741
 							SELECT r.guid, r.searchname, r.id
742 742
 							FROM releases r %s %s %s %s',
743 743
                     $regexSQL,
744
-                    ! empty($searchResult) ? ' WHERE r.id IN ('.implode(',', $searchResult).')' : '',
744
+                    !empty($searchResult) ? ' WHERE r.id IN ('.implode(',', $searchResult).')' : '',
745 745
                     $groupID,
746 746
                     $this->crapTime,
747 747
                 );
@@ -1107,7 +1107,7 @@  discard block
 block discarded – undo
1107 1107
                     }
1108 1108
                     break;
1109 1109
                 case 'size':
1110
-                    if (! is_numeric($args[2])) {
1110
+                    if (!is_numeric($args[2])) {
1111 1111
                         break;
1112 1112
                     }
1113 1113
                     switch ($args[1]) {
@@ -1122,7 +1122,7 @@  discard block
 block discarded – undo
1122 1122
                     }
1123 1123
                     break;
1124 1124
                 case 'adddate':
1125
-                    if (! is_numeric($args[2])) {
1125
+                    if (!is_numeric($args[2])) {
1126 1126
                         break;
1127 1127
                     }
1128 1128
                     switch ($args[1]) {
@@ -1135,7 +1135,7 @@  discard block
 block discarded – undo
1135 1135
                     }
1136 1136
                     break;
1137 1137
                 case 'postdate':
1138
-                    if (! is_numeric($args[2])) {
1138
+                    if (!is_numeric($args[2])) {
1139 1139
                         break;
1140 1140
                     }
1141 1141
                     switch ($args[1]) {
@@ -1148,7 +1148,7 @@  discard block
 block discarded – undo
1148 1148
                     }
1149 1149
                     break;
1150 1150
                 case 'completion':
1151
-                    if (! is_numeric($args[2])) {
1151
+                    if (!is_numeric($args[2])) {
1152 1152
                         break;
1153 1153
                     }
1154 1154
                     if ($args[1] === 'smaller') {
Please login to merge, or discard this patch.
Blacklight/Nfo.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         $this->colorCli = new ColorCLI;
76 76
 
77 77
         $this->tmpPath = config('nntmux.tmp_unrar_path');
78
-        if (! preg_match('/[\/\\\\]$/', $this->tmpPath)) {
78
+        if (!preg_match('/[\/\\\\]$/', $this->tmpPath)) {
79 79
             $this->tmpPath .= '/';
80 80
         }
81 81
     }
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         $size = \strlen($possibleNFO);
137 137
         if ($size < 65535 &&
138 138
             $size > 11 &&
139
-            ! preg_match(
139
+            !preg_match(
140 140
                 '/\A(\s*<\?xml|=newz\[NZB\]=|RIFF|\s*[RP]AR|.{0,10}(JFIF|matroska|ftyp|ID3))|;\s*Generated\s*by.*SF\w/i',
141 141
                 $possibleNFO
142 142
             )) {
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 
147 147
             // Linux boxes have 'file' (so should Macs), Windows *can* have it too: see GNUWIN.txt in docs.
148 148
             $result = Utility::fileInfo($tmpPath);
149
-            if (! empty($result)) {
149
+            if (!empty($result)) {
150 150
                 // Check if it's text.
151 151
                 if (preg_match('/(ASCII|ISO-8859|UTF-(8|16|32).*?)\s*text/', $result)) {
152 152
                     @File::delete($tmpPath);
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 
200 200
             Release::whereId($release->id)->update(['nfostatus' => self::NFO_FOUND]);
201 201
 
202
-            if (! isset($release->completion)) {
202
+            if (!isset($release->completion)) {
203 203
                 $release->completion = 0;
204 204
             }
205 205
 
Please login to merge, or discard this patch.
Blacklight/PopulateAniDB.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
                     $episodeArray[$i]['episode_no'] = (int) $episode->epno;
125 125
                     $episodeArray[$i]['airdate'] = (string) $episode->airdate;
126 126
 
127
-                    if (! empty($episode->title)) {
127
+                    if (!empty($episode->title)) {
128 128
                         foreach ($episode->title as $title) {
129 129
                             $xmlAttribs = $title->attributes('xml', true);
130 130
                             // only english, x-jat imploded episode titles for now
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
                     'updated' => now(),
245 245
                 ]
246 246
             );
247
-        if (! empty($AniDBInfoArray['epsarr'])) {
247
+        if (!empty($AniDBInfoArray['epsarr'])) {
248 248
             $this->insertAniDBEpisodes($aniDbId, $AniDBInfoArray['epsarr']);
249 249
         }
250 250
 
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
 
254 254
     private function insertAniDBEpisodes($aniDbId, array $episodeArr = []): void
255 255
     {
256
-        if (! empty($episodeArr)) {
256
+        if (!empty($episodeArr)) {
257 257
             foreach ($episodeArr as $episode) {
258 258
                 AnidbEpisode::insertOrIgnore(
259 259
                     [
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
                     'updated' => now(),
413 413
                 ]
414 414
             );
415
-        if (! empty($AniDBInfoArray['epsarr'])) {
415
+        if (!empty($AniDBInfoArray['epsarr'])) {
416 416
             $this->insertAniDBEpisodes($aniDbId, $AniDBInfoArray['epsarr']);
417 417
         }
418 418
 
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
             $picture = $this->updateAniDBInfoEps($aniDbId, $AniDBInfoArray);
430 430
         }
431 431
 
432
-        if (! empty($picture) && ! file_exists($this->imgSavePath.$aniDbId.'.jpg')) {
432
+        if (!empty($picture) && !file_exists($this->imgSavePath.$aniDbId.'.jpg')) {
433 433
             (new ReleaseImage)->saveImage(
434 434
                 $aniDbId,
435 435
                 'http://img7.anidb.net/pics/anime/'.$picture,
Please login to merge, or discard this patch.
app/Http/Controllers/Api/ApiV2Controller.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
                 'search' => ['available' => 'yes', 'supportedParams' => 'id'],
52 52
                 'tv-search' => ['available' => 'yes', 'supportedParams' => 'id,vid,tvdbid,traktid,rid,tvmazeid,imdbid,tmdbid,season,ep'],
53 53
                 'movie-search' => ['available' => 'yes', 'supportedParams' => 'id, imdbid, tmdbid, traktid'],
54
-                'audio-search' => ['available' => 'no',  'supportedParams' => ''],
54
+                'audio-search' => ['available' => 'no', 'supportedParams' => ''],
55 55
             ],
56 56
             'categories' => fractal($category, new CategoryTransformer),
57 57
         ];
Please login to merge, or discard this patch.
app/Http/Controllers/Api/ApiInformController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,18 +19,18 @@
 block discarded – undo
19 19
      */
20 20
     public function release(Request $request): \Illuminate\Http\JsonResponse
21 21
     {
22
-        $releaseObName = $request->has('relo') && ! empty($request->input('relo')) ? $request->input('relo') : '';
23
-        $releasePrName = $request->has('relp') && ! empty($request->input('relp')) ? $request->input('relp') : '';
24
-        $apiToken = $request->has('api_token') && ! empty($request->input('api_token')) ? $request->input('api_token') : '';
22
+        $releaseObName = $request->has('relo') && !empty($request->input('relo')) ? $request->input('relo') : '';
23
+        $releasePrName = $request->has('relp') && !empty($request->input('relp')) ? $request->input('relp') : '';
24
+        $apiToken = $request->has('api_token') && !empty($request->input('api_token')) ? $request->input('api_token') : '';
25 25
         $user = User::query()->where('api_token', $request->input('api_token'))->first();
26
-        if (! $user) {
26
+        if (!$user) {
27 27
             return response()->json(['message' => 'Indexer inform error, wrong api key!'], 404);
28 28
         }
29 29
 
30
-        if (! empty($releaseObName) && ! empty($releasePrName) && ! empty($apiToken)) {
30
+        if (!empty($releaseObName) && !empty($releasePrName) && !empty($apiToken)) {
31 31
             ReleaseInform::insertOrIgnore(['relOName' => $releaseObName, 'relPName' => $releasePrName, 'api_token' => $apiToken, 'created_at' => now(), 'updated_at' => now()]);
32 32
             $release = Release::whereSearchname($releaseObName)->first();
33
-            if (! empty($release)) {
33
+            if (!empty($release)) {
34 34
                 (new NameFixer)->updateRelease($release, $releasePrName, 'Release Inform API', true, 'Filenames, ', 1, true);
35 35
             }
36 36
 
Please login to merge, or discard this patch.
app/Models/Predb.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@
 block discarded – undo
196 196
             return $predb;
197 197
         }
198 198
         $sql = self::query()->leftJoin('releases', 'releases.predb_id', '=', 'predb.id')->orderByDesc('predb.predate');
199
-        if (! empty($search)) {
199
+        if (!empty($search)) {
200 200
             if (config('nntmux.elasticsearch_enabled') === true) {
201 201
                 $ids = (new ElasticSearchSiteSearch)->predbIndexSearch($search);
202 202
             } else {
Please login to merge, or discard this patch.
app/Models/Release.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
     public static function updateRelease($id, $name, $searchName, $fromName, $categoryId, $parts, $grabs, $size, $postedDate, $addedDate, $videoId, $episodeId, $imDbId, $aniDbId): void
276 276
     {
277 277
         $movieInfoId = null;
278
-        if (! empty($imDbId)) {
278
+        if (!empty($imDbId)) {
279 279
             $movieInfoId = MovieInfo::whereImdbid($imDbId)->first(['id']);
280 280
         }
281 281
         self::whereId($id)->update(
@@ -526,12 +526,12 @@  discard block
 block discarded – undo
526 526
 
527 527
         preg_match('/(^\w+[-_. ].+?\.(\d+p)).+/i', $rel['searchname'], $similar);
528 528
 
529
-        if (! empty($similar)) {
529
+        if (!empty($similar)) {
530 530
             if (config('nntmux.elasticsearch_enabled') === true) {
531 531
                 $searchResult = (new ElasticSearchSiteSearch)->indexSearch($similar[1], 10);
532 532
             } else {
533 533
                 $searchResult = (new ManticoreSearch)->searchIndexes('releases_rt', $similar[1]);
534
-                if (! empty($searchResult)) {
534
+                if (!empty($searchResult)) {
535 535
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
536 536
                 }
537 537
             }
Please login to merge, or discard this patch.
app/Console/Commands/NntmuxPopulateSearchIndexes.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $manticore->truncateRTIndex(Arr::wrap('releases_rt'));
65 65
         $data = [];
66 66
         $total = Release::count();
67
-        if (! $total) {
67
+        if (!$total) {
68 68
             $this->warn('Releases table is empty. Nothing to do.');
69 69
             exit();
70 70
         }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             ->select(['releases.id', 'releases.name', 'releases.searchname', 'releases.fromname', 'releases.categories_id'])
85 85
             ->selectRaw('IFNULL(GROUP_CONCAT(release_files.name SEPARATOR " "),"") filename')
86 86
             ->groupBy('id')
87
-            ->chunk($max, function ($releases) use ($manticore, $bar, $data) {
87
+            ->chunk($max, function($releases) use ($manticore, $bar, $data) {
88 88
                 foreach ($releases as $r) {
89 89
                     $data[] = [
90 90
                         'id' => $r->id,
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         $data = [];
113 113
 
114 114
         $total = Predb::count();
115
-        if (! $total) {
115
+        if (!$total) {
116 116
             $this->warn('PreDB table is empty. Nothing to do.');
117 117
             exit();
118 118
         }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             ->select(['id', 'title', 'filename', 'source'])
130 130
             ->groupBy('id')
131 131
             ->orderBy('id')
132
-            ->chunk($max, function ($pre) use ($manticore, $bar, $data) {
132
+            ->chunk($max, function($pre) use ($manticore, $bar, $data) {
133 133
                 foreach ($pre as $p) {
134 134
                     $data[] = [
135 135
                         'id' => $p->id,
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         $data = ['body' => []];
152 152
         $elastic = new ElasticSearchSiteSearch;
153 153
         $total = Release::count();
154
-        if (! $total) {
154
+        if (!$total) {
155 155
             $this->warn('Could not get database information for releases table.');
156 156
             exit();
157 157
         }
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             ->select(['releases.id', 'releases.name', 'releases.searchname', 'releases.fromname', 'releases.categories_id', 'releases.postdate'])
170 170
             ->selectRaw('IFNULL(GROUP_CONCAT(release_files.name SEPARATOR " "),"") filename')
171 171
             ->groupBy('id')
172
-            ->chunk($max, function ($releases) use ($bar, $data) {
172
+            ->chunk($max, function($releases) use ($bar, $data) {
173 173
                 foreach ($releases as $r) {
174 174
                     $searchName = str_replace(['.', '-'], ' ', $r->searchname);
175 175
                     $data['body'][] = [
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         $data = ['body' => []];
203 203
         $elastic = new ElasticSearchSiteSearch;
204 204
         $total = Predb::count();
205
-        if (! $total) {
205
+        if (!$total) {
206 206
             $this->warn('Could not get database information for predb table.');
207 207
             exit();
208 208
         }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
             ->select(['id', 'title', 'filename', 'source'])
220 220
             ->groupBy('id')
221 221
             ->orderBy('id')
222
-            ->chunk($max, function ($pre) use ($bar, $data) {
222
+            ->chunk($max, function($pre) use ($bar, $data) {
223 223
                 foreach ($pre as $p) {
224 224
                     $data['body'][] = [
225 225
                         'index' => [
Please login to merge, or discard this patch.
app/Console/Commands/CleanNZB.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     public function handle(): void
38 38
     {
39 39
         // Check if any options are false
40
-        if (! $this->option('notindb') && ! $this->option('notondisk')) {
40
+        if (!$this->option('notindb') && !$this->option('notondisk')) {
41 41
             $this->error('You must specify at least one option. See: --help');
42 42
             exit();
43 43
         }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             $guid = stristr($filePath->getFilename(), '.nzb.gz', true);
64 64
             if (File::isFile($filePath) && $guid) {
65 65
                 // If NZB file guid is not present in DB delete the file from disk
66
-                if (! $releases->whereGuid($guid)->exists()) {
66
+                if (!$releases->whereGuid($guid)->exists()) {
67 67
                     if ($delete) {
68 68
                         File::delete($filePath);
69 69
                     }
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
         $total = Release::count();
89 89
         $this->alert("Total releases to check: $total");
90 90
 
91
-        Release::where('nzbstatus', 1)->chunkById((int) $this->option('chunksize'), function (Collection $releases) use ($delete, &$checked, &$deleted, $nzb, $rel) {
91
+        Release::where('nzbstatus', 1)->chunkById((int) $this->option('chunksize'), function(Collection $releases) use ($delete, &$checked, &$deleted, $nzb, $rel) {
92 92
             echo 'Total done: '.$checked."\r";
93 93
             foreach ($releases as $r) {
94 94
 
95
-                if (! $nzb->NZBPath($r->guid)) {
95
+                if (!$nzb->NZBPath($r->guid)) {
96 96
                     if ($delete) {
97 97
                         $rel->deleteSingle(['g' => $r->guid, 'i' => $r->id], $nzb, new ReleaseImage);
98 98
                     }
Please login to merge, or discard this patch.