Passed
Pull Request — master (#1384)
by
unknown
12:21 queued 06:04
created
Blacklight/AniDB.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
      */
56 56
     public function deleteTitle(int $anidbID): void
57 57
     {
58
-        DB::transaction(function () use ($anidbID) {
58
+        DB::transaction(function() use ($anidbID) {
59 59
             DB::delete(
60 60
                 sprintf(
61 61
                     '
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/NZBContents.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                     $foundNFO = true;
140 140
                 }
141 141
 
142
-                if ($foundNFO === false && $hiddenNFO === false && preg_match('/\(1\/1\)$/i', $subject) && ! preg_match('/\.(apk|bat|bmp|cbr|cbz|cfg|css|csv|cue|db|dll|doc|epub|exe|gif|htm|ico|idx|ini'.'|jpg|lit|log|m3u|mid|mobi|mp3|nib|nzb|odt|opf|otf|par|par2|pdf|psd|pps|png|ppt|r\d{2,4}'.'|rar|sfv|srr|sub|srt|sql|rom|rtf|tif|torrent|ttf|txt|vb|vol\d+\+\d+|wps|xml|zip)/i', $subject)) {
142
+                if ($foundNFO === false && $hiddenNFO === false && preg_match('/\(1\/1\)$/i', $subject) && !preg_match('/\.(apk|bat|bmp|cbr|cbz|cfg|css|csv|cue|db|dll|doc|epub|exe|gif|htm|ico|idx|ini'.'|jpg|lit|log|m3u|mid|mobi|mp3|nib|nzb|odt|opf|otf|par|par2|pdf|psd|pps|png|ppt|r\d{2,4}'.'|rar|sfv|srr|sub|srt|sql|rom|rtf|tif|torrent|ttf|txt|vb|vol\d+\+\d+|wps|xml|zip)/i', $subject)) {
143 143
                     $hiddenID = (string) $nzbcontents->segments->segment;
144 144
                     $hiddenNFO = true;
145 145
                 }
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
             return false;
185 185
         }
186 186
         $nzbContents = Utility::unzipGzipFile($nzbPath);
187
-        if (! $nzbContents) {
187
+        if (!$nzbContents) {
188 188
             if ($this->echooutput) {
189 189
                 echo PHP_EOL.
190 190
                     'Unable to decompress: '.
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         }
200 200
 
201 201
         $nzbFile = @simplexml_load_string($nzbContents);
202
-        if (! $nzbFile) {
202
+        if (!$nzbFile) {
203 203
             if ($this->echooutput) {
204 204
                 echo PHP_EOL."Unable to load NZB: $guid appears to be an invalid NZB, skipping.".PHP_EOL;
205 205
             }
Please login to merge, or discard this patch.
Blacklight/libraries/TraktAPI.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         $url = self::API_URL."shows/{$id}/seasons/{$season}/episodes/{$ep}";
58 58
 
59 59
         $array = $this->getJsonArray($url, $extended);
60
-        if (! \is_array($array)) {
60
+        if (!\is_array($array)) {
61 61
             return false;
62 62
         }
63 63
 
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         $array = $this->getJsonArray(
73 73
             self::API_URL.'movies/boxoffice'
74 74
         );
75
-        if (! $array) {
75
+        if (!$array) {
76 76
             return false;
77 77
         }
78 78
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
         $array = $this->getJsonArray(
88 88
             self::API_URL.'calendars/all/shows/'.$start.'/'.$days
89 89
         );
90
-        if (! $array) {
90
+        if (!$array) {
91 91
             return false;
92 92
         }
93 93
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
             $extendedString = '?extended='.$extended;
108 108
         }
109 109
 
110
-        if (! empty($this->requestHeaders)) {
110
+        if (!empty($this->requestHeaders)) {
111 111
             try {
112 112
                 $json = $this->client->get(
113 113
                     $URI.$extendedString,
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
                 return false;
122 122
             }
123 123
 
124
-            if (! empty($json)) {
124
+            if (!empty($json)) {
125 125
                 $json = json_decode($json, true);
126
-                if (! \is_array($json) || (isset($json['status']) && $json['status'] === 'failure')) {
126
+                if (!\is_array($json) || (isset($json['status']) && $json['status'] === 'failure')) {
127 127
                     return false;
128 128
                 }
129 129
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
             default => 'min',
147 147
         };
148 148
         $array = $this->getJsonArray(self::API_URL.'movies/'.Str::slug($movie), $extended);
149
-        if (! $array) {
149
+        if (!$array) {
150 150
             return false;
151 151
         }
152 152
         if ($type === 'imdbid' && isset($array['ids']['imdb'])) {
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
      */
164 164
     public function searchId(int|string $id, string $site = 'trakt', int|string $type = 0)
165 165
     {
166
-        if (! \in_array($site, self::$types, false) || ! ctype_digit($id)) {
166
+        if (!\in_array($site, self::$types, false) || !ctype_digit($id)) {
167 167
             return;
168 168
         }
169 169
         if ($site === 'imdb') {
Please login to merge, or discard this patch.
Blacklight/libraries/Geary.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,10 +16,10 @@  discard block
 block discarded – undo
16 16
  * Updated for NNTmux by DariusIII
17 17
  */
18 18
 
19
-if (! \function_exists('getAllHeaders')) {
19
+if (!\function_exists('getAllHeaders')) {
20 20
     function getAllHeaders()
21 21
     {
22
-        if (! \is_array($_SERVER)) {
22
+        if (!\is_array($_SERVER)) {
23 23
             return [];
24 24
         }
25 25
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
     private function prepare_header(array $data): array
278 278
     {
279 279
         $params = $data['params'];
280
-        $params_query = ! \is_array($params) ? "/$params" : '?'.http_build_query($params);
280
+        $params_query = !\is_array($params) ? "/$params" : '?'.http_build_query($params);
281 281
 
282 282
         $nonce = (int) round(microtime(true) * 1000);
283 283
         $body = '';
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 
320 320
         curl_setopt_array($ch, $curl_data);
321 321
 
322
-        if (! $result = curl_exec($ch)) {
322
+        if (!$result = curl_exec($ch)) {
323 323
             return $this->curl_error($ch);
324 324
         }
325 325
 
Please login to merge, or discard this patch.
Blacklight/libraries/Forking.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -273,14 +273,14 @@  discard block
 block discarded – undo
273 273
         $this->processWork();
274 274
         $maxWork = \count($this->work);
275 275
         foreach ($this->work as $group) {
276
-            $pool->add(function () use ($group) {
276
+            $pool->add(function() use ($group) {
277 277
                 return $this->_executeCommand(PHP_BINARY.' misc/update/backfill.php '.$group->name.(isset($group->max) ? (' '.$group->max) : ''));
278
-            }, 2000000)->then(function ($output) use ($group, $maxWork) {
278
+            }, 2000000)->then(function($output) use ($group, $maxWork) {
279 279
                 echo $output;
280 280
                 $this->colorCli->primary('Task #'.$maxWork.' Backfilled group '.$group->name);
281
-            })->catch(function (\Throwable $exception) {
281
+            })->catch(function(\Throwable $exception) {
282 282
                 echo $exception->getMessage();
283
-            })->catch(static function (SerializableException $serializableException) {
283
+            })->catch(static function(SerializableException $serializableException) {
284 284
                 //we do nothing here just catch the error and move on
285 285
             });
286 286
             $maxWork--;
@@ -368,14 +368,14 @@  discard block
 block discarded – undo
368 368
 
369 369
             $this->processWork();
370 370
             foreach ($queues as $queue) {
371
-                $pool->add(function () use ($queue) {
371
+                $pool->add(function() use ($queue) {
372 372
                     return $this->_executeCommand($this->dnr_path.$queue.'"');
373
-                }, 2000000)->then(function ($output) use ($data) {
373
+                }, 2000000)->then(function($output) use ($data) {
374 374
                     echo $output;
375 375
                     $this->colorCli->primary('Backfilled group '.$data[0]->name);
376
-                })->catch(function (\Throwable $exception) {
376
+                })->catch(function(\Throwable $exception) {
377 377
                     echo $exception->getMessage();
378
-                })->catch(static function (SerializableException $serializableException) {
378
+                })->catch(static function(SerializableException $serializableException) {
379 379
                     //we do nothing here just catch the error and move on
380 380
                 });
381 381
             }
@@ -404,14 +404,14 @@  discard block
 block discarded – undo
404 404
 
405 405
         $this->processWork();
406 406
         foreach ($this->work as $group) {
407
-            $pool->add(function () use ($group) {
407
+            $pool->add(function() use ($group) {
408 408
                 return $this->_executeCommand(PHP_BINARY.' misc/update/update_binaries.php '.$group->name.' '.$group->max);
409
-            }, 2000000)->then(function ($output) use ($group, $maxWork) {
409
+            }, 2000000)->then(function($output) use ($group, $maxWork) {
410 410
                 echo $output;
411 411
                 $this->colorCli->primary('Task #'.$maxWork.' Updated group '.$group->name);
412
-            })->catch(function (\Throwable $exception) {
412
+            })->catch(function(\Throwable $exception) {
413 413
                 echo $exception->getMessage();
414
-            })->catch(static function (SerializableException $serializableException) {
414
+            })->catch(static function(SerializableException $serializableException) {
415 415
                 //we do nothing here just catch the error and move on
416 416
             });
417 417
             $maxWork--;
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
 			ORDER BY a.last_record DESC'
439 439
         );
440 440
 
441
-        if (! empty($this->work)) {
441
+        if (!empty($this->work)) {
442 442
             $i = 1;
443 443
             $queues = [];
444 444
             foreach ($this->work as $group) {
@@ -471,16 +471,16 @@  discard block
 block discarded – undo
471 471
             $this->processWork();
472 472
             foreach ($queues as $queue) {
473 473
                 preg_match('/alt\..+/i', $queue, $hit);
474
-                $pool->add(function () use ($queue) {
474
+                $pool->add(function() use ($queue) {
475 475
                     return $this->_executeCommand($this->dnr_path.$queue.'"');
476
-                }, 2000000)->then(function ($output) use ($hit) {
477
-                    if (! empty($hit)) {
476
+                }, 2000000)->then(function($output) use ($hit) {
477
+                    if (!empty($hit)) {
478 478
                         echo $output;
479 479
                         $this->colorCli->primary('Updated group '.$hit[0]);
480 480
                     }
481
-                })->catch(function (\Throwable $exception) {
481
+                })->catch(function(\Throwable $exception) {
482 482
                     echo $exception->getMessage();
483
-                })->catch(static function (SerializableException $serializableException) {
483
+                })->catch(static function(SerializableException $serializableException) {
484 484
                     //we do nothing here just catch the error and move on
485 485
                 });
486 486
             }
@@ -543,14 +543,14 @@  discard block
 block discarded – undo
543 543
 
544 544
         $this->processWork();
545 545
         foreach ($this->work as $queue) {
546
-            $pool->add(function () use ($queue) {
546
+            $pool->add(function() use ($queue) {
547 547
                 return $this->_executeCommand(PHP_BINARY.' misc/update/tmux/bin/groupfixrelnames.php "'.$queue.'"'.' true');
548
-            }, 2000000)->then(function ($output) use ($maxWork) {
548
+            }, 2000000)->then(function($output) use ($maxWork) {
549 549
                 echo $output;
550 550
                 $this->colorCli->primary('Task #'.$maxWork.' Finished fixing releases names');
551
-            })->catch(function (\Throwable $exception) {
551
+            })->catch(function(\Throwable $exception) {
552 552
                 echo $exception->getMessage();
553
-            })->catch(static function (SerializableException $serializableException) {
553
+            })->catch(static function(SerializableException $serializableException) {
554 554
                 //we do nothing here just catch the error and move on
555 555
             });
556 556
             $maxWork--;
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
         foreach ($work as $group) {
572 572
             try {
573 573
                 $query = DB::select(sprintf('SELECT id FROM collections WHERE groups_id = %d LIMIT 1', $group->id));
574
-                if (! empty($query)) {
574
+                if (!empty($query)) {
575 575
                     $uGroups[] = ['id' => $group->id, 'name' => $group->name];
576 576
                 }
577 577
             } catch (\PDOException $e) {
@@ -589,14 +589,14 @@  discard block
 block discarded – undo
589 589
 
590 590
         $this->processWork();
591 591
         foreach ($uGroups as $group) {
592
-            $pool->add(function () use ($group) {
592
+            $pool->add(function() use ($group) {
593 593
                 return $this->_executeCommand($this->dnr_path.'releases  '.$group['id'].'"');
594
-            }, 2000000)->then(function ($output) use ($maxWork) {
594
+            }, 2000000)->then(function($output) use ($maxWork) {
595 595
                 echo $output;
596 596
                 $this->colorCli->primary('Task #'.$maxWork.' Finished performing release processing');
597
-            })->catch(function (\Throwable $exception) {
597
+            })->catch(function(\Throwable $exception) {
598 598
                 echo $exception->getMessage();
599
-            })->catch(static function (SerializableException $serializableException) {
599
+            })->catch(static function(SerializableException $serializableException) {
600 600
                 //we do nothing here just catch the error and move on
601 601
             });
602 602
             $maxWork--;
@@ -633,16 +633,16 @@  discard block
 block discarded – undo
633 633
         $this->processWork();
634 634
         foreach ($releases as $release) {
635 635
             if ($type !== '') {
636
-                $pool->add(function () use ($release, $type) {
636
+                $pool->add(function() use ($release, $type) {
637 637
                     return $this->_executeCommand(PHP_BINARY.' misc/update/postprocess.php '.$type.$release->id);
638
-                }, 2000000)->then(function ($output) use ($desc, $count) {
638
+                }, 2000000)->then(function($output) use ($desc, $count) {
639 639
                     echo $output;
640 640
                     $this->colorCli->primary('Finished task #'.$count.' for '.$desc);
641
-                })->catch(function (\Throwable $exception) {
641
+                })->catch(function(\Throwable $exception) {
642 642
                     echo $exception->getMessage();
643
-                })->catch(static function (SerializableException $serializableException) {
643
+                })->catch(static function(SerializableException $serializableException) {
644 644
                     //we do nothing here just catch the error and move on
645
-                })->timeout(function () use ($count) {
645
+                })->timeout(function() use ($count) {
646 646
                     $this->colorCli->notice('Task #'.$count.': Timeout occurred.');
647 647
                 });
648 648
                 $count--;
@@ -890,15 +890,15 @@  discard block
 block discarded – undo
890 890
         $pool = Pool::create()->concurrency($maxProcess)->timeout(config('nntmux.multiprocessing_max_child_time'));
891 891
         $this->processWork();
892 892
         foreach ($this->work as $group) {
893
-            $pool->add(function () use ($group) {
893
+            $pool->add(function() use ($group) {
894 894
                 return $this->_executeCommand($this->dnr_path.'update_per_group  '.$group->id.'"');
895
-            }, 2000000)->then(function ($output) use ($group) {
895
+            }, 2000000)->then(function($output) use ($group) {
896 896
                 echo $output;
897 897
                 $name = UsenetGroup::getNameByID($group->id);
898 898
                 $this->colorCli->primary('Finished updating binaries, processing releases and additional postprocessing for group:'.$name);
899
-            })->catch(function (\Throwable $exception) {
899
+            })->catch(function(\Throwable $exception) {
900 900
                 echo $exception->getMessage();
901
-            })->catch(static function (SerializableException $serializableException) {
901
+            })->catch(static function(SerializableException $serializableException) {
902 902
                 echo $serializableException->asThrowable()->getMessage();
903 903
             });
904 904
         }
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
     {
915 915
         $process = Process::fromShellCommandline($command);
916 916
         $process->setTimeout(1800);
917
-        $process->run(function ($type, $buffer) {
917
+        $process->run(function($type, $buffer) {
918 918
             if (Process::ERR === $type) {
919 919
                 echo $buffer;
920 920
             }
Please login to merge, or discard this patch.
Blacklight/libraries/ForkingImportNZB.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
         foreach ($directories as $directory) {
63 63
             $pool = Pool::create()->concurrency($maxProcesses)->timeout(3600);
64
-            $pool->add(function () use ($directory) {
64
+            $pool->add(function() use ($directory) {
65 65
                 $this->_executeCommand(
66 66
                     $this->importPath.'"'.
67 67
                     $directory.'" '.
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
                     $this->useFileName.' '.
71 71
                     $this->maxPerProcess
72 72
                 );
73
-            })->then(function () {
73
+            })->then(function() {
74 74
                 $this->colorCli->header('Finished importing new nzbs', true);
75
-            })->catch(function (\Throwable $exception) {
75
+            })->catch(function(\Throwable $exception) {
76 76
                 // Handle exception
77 77
             });
78 78
             $pool->wait();
Please login to merge, or discard this patch.
Blacklight/db/populate/AniDB.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
                     $episodeArray[$i]['episode_no'] = (int) $episode->epno;
133 133
                     $episodeArray[$i]['airdate'] = (string) $episode->airdate;
134 134
 
135
-                    if (! empty($episode->title)) {
135
+                    if (!empty($episode->title)) {
136 136
                         foreach ($episode->title as $title) {
137 137
                             $xmlAttribs = $title->attributes('xml', true);
138 138
                             // only english, x-jat imploded episode titles for now
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
                     'updated' => now(),
253 253
                 ]
254 254
             );
255
-        if (! empty($AniDBInfoArray['epsarr'])) {
255
+        if (!empty($AniDBInfoArray['epsarr'])) {
256 256
             $this->insertAniDBEpisodes($aniDbId, $AniDBInfoArray['epsarr']);
257 257
         }
258 258
 
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 
262 262
     private function insertAniDBEpisodes($aniDbId, array $episodeArr = []): void
263 263
     {
264
-        if (! empty($episodeArr)) {
264
+        if (!empty($episodeArr)) {
265 265
             foreach ($episodeArr as $episode) {
266 266
                 AnidbEpisode::insertOrIgnore(
267 267
                     [
@@ -420,7 +420,7 @@  discard block
 block discarded – undo
420 420
                     'updated' => now(),
421 421
                 ]
422 422
             );
423
-        if (! empty($AniDBInfoArray['epsarr'])) {
423
+        if (!empty($AniDBInfoArray['epsarr'])) {
424 424
             $this->insertAniDBEpisodes($aniDbId, $AniDBInfoArray['epsarr']);
425 425
         }
426 426
 
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
             $picture = $this->updateAniDBInfoEps($aniDbId, $AniDBInfoArray);
438 438
         }
439 439
 
440
-        if (! empty($picture) && ! file_exists($this->imgSavePath.$aniDbId.'.jpg')) {
440
+        if (!empty($picture) && !file_exists($this->imgSavePath.$aniDbId.'.jpg')) {
441 441
             (new ReleaseImage())->saveImage(
442 442
                 $aniDbId,
443 443
                 'http://img7.anidb.net/pics/anime/'.$picture,
Please login to merge, or discard this patch.
Blacklight/Backfill.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
                 $this->colorCli->header($dMessage);
87 87
             }
88 88
 
89
-            if ($articles !== '' && ! is_numeric($articles)) {
89
+            if ($articles !== '' && !is_numeric($articles)) {
90 90
                 $articles = 20000;
91 91
             }
92 92
 
@@ -181,8 +181,7 @@  discard block
 block discarded – undo
181 181
             $dMessage =
182 182
                 'We have hit the maximum we can backfill for '.
183 183
                 $groupName.
184
-                ($this->_disableBackfillGroup ? ', disabling backfill on it.' :
185
-                ', skipping it, consider disabling backfill on it.');
184
+                ($this->_disableBackfillGroup ? ', disabling backfill on it.' : ', skipping it, consider disabling backfill on it.');
186 185
 
187 186
             if ($this->_disableBackfillGroup) {
188 187
                 UsenetGroup::updateGroupStatus($groupArr['id'], 'backfill', 0);
Please login to merge, or discard this patch.