Passed
Pull Request — master (#1387)
by
unknown
28:50 queued 22:28
created
Blacklight/Binaries.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 
385 385
             $done = false;
386 386
             // Get all the parts (in portions of $this->messageBuffer to not use too much memory).
387
-            while (! $done) {
387
+            while (!$done) {
388 388
                 // Increment last until we reach $groupLast (group newest article).
389 389
                 if ($total > $this->messageBuffer) {
390 390
                     if ((string) ($first + $this->messageBuffer) > $groupLast) {
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
                 $scanSummary = $this->scan($groupMySQL, $first, $last);
409 409
 
410 410
                 // Check if we fetched headers.
411
-                if (! empty($scanSummary)) {
411
+                if (!empty($scanSummary)) {
412 412
                     // If new group, update first record & postdate
413 413
                     if ($groupMySQL['first_record_postdate'] === null && (int) $groupMySQL['first_record'] === 0) {
414 414
                         $groupMySQL['first_record'] = $scanSummary['firstArticleNumber'];
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
                     }
433 433
 
434 434
                     $scanSummary['lastArticleDate'] = (isset($scanSummary['lastArticleDate']) ? strtotime($scanSummary['lastArticleDate']) : false);
435
-                    if (! is_numeric($scanSummary['lastArticleDate'])) {
435
+                    if (!is_numeric($scanSummary['lastArticleDate'])) {
436 436
                         $scanSummary['lastArticleDate'] = $this->postdate($scanSummary['lastArticleNumber'], $groupNNTP);
437 437
                     }
438 438
 
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
 
582 582
             // If set we are running in partRepair mode.
583 583
             if ($partRepair && $missingParts !== null) {
584
-                if (! \in_array($header['Number'], $missingParts, false)) {
584
+                if (!\in_array($header['Number'], $missingParts, false)) {
585 585
                     // If article isn't one that is missing skip it.
586 586
                     continue;
587 587
                 }
@@ -626,15 +626,15 @@  discard block
 block discarded – undo
626 626
 
627 627
         unset($headers); // Reclaim memory now that headers are split.
628 628
 
629
-        if (! empty($this->_binaryBlacklistIdsToUpdate)) {
629
+        if (!empty($this->_binaryBlacklistIdsToUpdate)) {
630 630
             $this->updateBlacklistUsage();
631 631
         }
632 632
 
633
-        if ($this->_echoCLI && ! $partRepair) {
633
+        if ($this->_echoCLI && !$partRepair) {
634 634
             $this->outputHeaderInitial();
635 635
         }
636 636
 
637
-        if (! empty($stdHeaders)) {
637
+        if (!empty($stdHeaders)) {
638 638
             $this->storeHeaders($stdHeaders);
639 639
         }
640 640
         unset($stdHeaders);
@@ -709,9 +709,9 @@  discard block
 block discarded – undo
709 709
         // Loop articles, figure out files/parts.
710 710
         foreach ($headers as $this->header) {
711 711
             // Set up the info for inserting into parts/binaries/collections tables.
712
-            if (! isset($articles[$this->header['matches'][1]])) {
712
+            if (!isset($articles[$this->header['matches'][1]])) {
713 713
                 // Attempt to find the file count. If it is not found, set it to 0.
714
-                if (! preg_match('/[[(\s](\d{1,5})(\/|[\s_]of[\s_]|-)(\d{1,5})[])\s$:]/i', $this->header['matches'][1], $fileCount)) {
714
+                if (!preg_match('/[[(\s](\d{1,5})(\/|[\s_]of[\s_]|-)(\d{1,5})[])\s$:]/i', $this->header['matches'][1], $fileCount)) {
715 715
                     $fileCount[1] = $fileCount[3] = 0;
716 716
                 }
717 717
 
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
                 $this->header['CollectionKey'] = $collMatch['name'].$fileCount[3];
724 724
 
725 725
                 // If this header's collection key isn't in memory, attempt to insert the collection
726
-                if (! isset($collectionIDs[$this->header['CollectionKey']])) {
726
+                if (!isset($collectionIDs[$this->header['CollectionKey']])) {
727 727
                     /* Date from header should be a string this format:
728 728
                      * 31 Mar 2014 15:36:04 GMT or 6 Oct 1998 04:38:40 -0500
729 729
                      * Still make sure it's not unix time, convert it to unix time if it is.
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
 
755 755
                     $finalXrefArray = [];
756 756
                     foreach ($tempHeaderXrefs as $tempHeaderXref) {
757
-                        if (! in_array($tempHeaderXref, $tempXrefsData, false)) {
757
+                        if (!in_array($tempHeaderXref, $tempXrefsData, false)) {
758 758
                             $finalXrefArray[] = $tempHeaderXref;
759 759
                         }
760 760
                     }
@@ -891,12 +891,12 @@  discard block
 block discarded – undo
891 891
         $iterator1 = 0;
892 892
         $iterator2 = $msgCount - 1;
893 893
         while (true) {
894
-            if (! isset($returnArray['firstArticleNumber']) && isset($headers[$iterator1]['Number'])) {
894
+            if (!isset($returnArray['firstArticleNumber']) && isset($headers[$iterator1]['Number'])) {
895 895
                 $returnArray['firstArticleNumber'] = $headers[$iterator1]['Number'];
896 896
                 $returnArray['firstArticleDate'] = $headers[$iterator1]['Date'];
897 897
             }
898 898
 
899
-            if (! isset($returnArray['lastArticleNumber']) && isset($headers[$iterator2]['Number'])) {
899
+            if (!isset($returnArray['lastArticleNumber']) && isset($headers[$iterator2]['Number'])) {
900 900
                 $returnArray['lastArticleNumber'] = $headers[$iterator2]['Number'];
901 901
                 $returnArray['lastArticleDate'] = $headers[$iterator2]['Date'];
902 902
             }
@@ -1070,7 +1070,7 @@  discard block
 block discarded – undo
1070 1070
         }
1071 1071
 
1072 1072
         // Remove articles that we cant fetch after x attempts.
1073
-        DB::transaction(function () use ($groupArr) {
1073
+        DB::transaction(function() use ($groupArr) {
1074 1074
             DB::delete(
1075 1075
                 sprintf(
1076 1076
                     'DELETE FROM missed_parts WHERE attempts >= %d AND groups_id = %d',
@@ -1109,14 +1109,14 @@  discard block
 block discarded – undo
1109 1109
                     $currentPost
1110 1110
                 )
1111 1111
             );
1112
-            if (! empty($local) && \count($local) > 0) {
1112
+            if (!empty($local) && \count($local) > 0) {
1113 1113
                 $date = $local[0]->date;
1114 1114
                 break;
1115 1115
             }
1116 1116
 
1117 1117
             // If we could not find it locally, try usenet.
1118 1118
             $header = $this->_nntp->getXOVER($currentPost);
1119
-            if (! $this->_nntp::isError($header) && isset($header[0]['Date']) && $header[0]['Date'] !== '') {
1119
+            if (!$this->_nntp::isError($header) && isset($header[0]['Date']) && $header[0]['Date'] !== '') {
1120 1120
                 $date = $header[0]['Date'];
1121 1121
                 break;
1122 1122
             }
@@ -1141,7 +1141,7 @@  discard block
 block discarded – undo
1141 1141
         } while ($attempts++ <= 20);
1142 1142
 
1143 1143
         // If we didn't get a date, set it to now.
1144
-        if (! $date) {
1144
+        if (!$date) {
1145 1145
             $date = time();
1146 1146
         } else {
1147 1147
             $date = strtotime($date);
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
             $articleTime = $this->postdate($wantedArticle, $data);
1205 1205
 
1206 1206
             // Article doesn't exist, start again with something random
1207
-            if (! $articleTime) {
1207
+            if (!$articleTime) {
1208 1208
                 $wantedArticle = random_int($aMin, $aMax);
1209 1209
                 $articleTime = $this->postdate($wantedArticle, $data);
1210 1210
             }
@@ -1278,7 +1278,7 @@  discard block
 block discarded – undo
1278 1278
         foreach ($numbers as $number) {
1279 1279
             $sql .= $number.',';
1280 1280
         }
1281
-        DB::transaction(static function () use ($groupID, $sql) {
1281
+        DB::transaction(static function() use ($groupID, $sql) {
1282 1282
             DB::delete(rtrim($sql, ',').') AND groups_id = '.$groupID);
1283 1283
         }, 10);
1284 1284
     }
@@ -1293,10 +1293,10 @@  discard block
 block discarded – undo
1293 1293
      */
1294 1294
     protected function _retrieveBlackList(string $groupName): void
1295 1295
     {
1296
-        if (! isset($this->blackList[$groupName])) {
1296
+        if (!isset($this->blackList[$groupName])) {
1297 1297
             $this->blackList[$groupName] = $this->getBlacklist(true, self::OPTYPE_BLACKLIST, $groupName, true);
1298 1298
         }
1299
-        if (! isset($this->whiteList[$groupName])) {
1299
+        if (!isset($this->whiteList[$groupName])) {
1300 1300
             $this->whiteList[$groupName] = $this->getBlacklist(true, self::OPTYPE_WHITELIST, $groupName, true);
1301 1301
         }
1302 1302
         $this->_listsFound[$groupName] = ($this->blackList[$groupName] || $this->whiteList[$groupName]);
@@ -1310,10 +1310,10 @@  discard block
 block discarded – undo
1310 1310
      */
1311 1311
     public function isBlackListed(array $msg, string $groupName): bool
1312 1312
     {
1313
-        if (! isset($this->_listsFound[$groupName])) {
1313
+        if (!isset($this->_listsFound[$groupName])) {
1314 1314
             $this->_retrieveBlackList($groupName);
1315 1315
         }
1316
-        if (! $this->_listsFound[$groupName]) {
1316
+        if (!$this->_listsFound[$groupName]) {
1317 1317
             return false;
1318 1318
         }
1319 1319
 
@@ -1341,7 +1341,7 @@  discard block
 block discarded – undo
1341 1341
 
1342 1342
         // Check if the field is black listed.
1343 1343
 
1344
-        if (! $blackListed && $this->blackList[$groupName]) {
1344
+        if (!$blackListed && $this->blackList[$groupName]) {
1345 1345
             foreach ($this->blackList[$groupName] as $blackList) {
1346 1346
                 if (preg_match('/'.$blackList->regex.'/i', $field[$blackList->msgcol])) {
1347 1347
                     $blackListed = true;
@@ -1449,7 +1449,7 @@  discard block
 block discarded – undo
1449 1449
      */
1450 1450
     public function delete(int $collectionID): void
1451 1451
     {
1452
-        DB::transaction(static function () use ($collectionID) {
1452
+        DB::transaction(static function() use ($collectionID) {
1453 1453
             DB::delete(sprintf('DELETE FROM collections WHERE id = %d', $collectionID));
1454 1454
         }, 10);
1455 1455
 
Please login to merge, or discard this patch.
Blacklight/Categorize.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     public function isTV(): bool
101 101
     {
102 102
         if (preg_match('/Daily[\-_\.]Show|Nightly News|^\[[a-zA-Z\.\-]+\].*[\-_].*\d{1,3}[\-_. ](([\[\(])(h264-)?\d{3,4}([pi])([\]\)])\s?(\[AAC\])?|\[[a-fA-F0-9]{8}\]|(8|10)BIT|hi10p)(\[[a-fA-F0-9]{8}\])?|(\d\d-){2}[12]\d{3}|[12]\d{3}(\.\d\d){2}|\d+x\d+|\.e\d{1,3}\.|s\d{1,4}[._ -]?[ed]\d{1,3}([ex]\d{1,3}|[\-.\w ])|[._ -](\dx\d\d|C4TV|Complete[._ -]Season|DSR|([DHPS])DTV|EP[._ -]?\d{1,3}|S\d{1,3}.+Extras|SUBPACK|Season[._ -]\d{1,2})([._ -]|$)|TVRIP|TV[._ -](19|20)\d\d|Troll(HD|UHD)/i', $this->releaseName)
103
-            && ! preg_match('/[._ -](flac|imageset|mp3|xxx)[._ -]|[ .]exe$/i', $this->releaseName)) {
103
+            && !preg_match('/[._ -](flac|imageset|mp3|xxx)[._ -]|[ .]exe$/i', $this->releaseName)) {
104 104
             switch (true) {
105 105
                 case $this->isOtherTV():
106 106
                 case $this->categorizeForeign && $this->isForeignTV():
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     {
138 138
         if (preg_match('/[._ -]S\d{1,3}.+(EP\d{1,3}|Extras|SUBPACK)[._ -]|News/i', $this->releaseName)
139 139
             //special case for "Have.I.Got.News.For.You" tv show
140
-            && ! preg_match('/[._ -]Got[._ -]News[._ -]For[._ -]You/i', $this->releaseName)
140
+            && !preg_match('/[._ -]Got[._ -]News[._ -]For[._ -]You/i', $this->releaseName)
141 141
         ) {
142 142
             $this->tmpCat = Category::TV_OTHER;
143 143
 
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 
225 225
             return true;
226 226
         }
227
-        if (! $this->catWebDL && preg_match('/web[._ -]dl|web-?rip/i', $this->releaseName)) {
227
+        if (!$this->catWebDL && preg_match('/web[._ -]dl|web-?rip/i', $this->releaseName)) {
228 228
             $this->tmpCat = Category::TV_HD;
229 229
 
230 230
             return true;
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 
285 285
     public function isMovie(): bool
286 286
     {
287
-        if (preg_match('/[._ -]AVC|[._ -]|[BH][DR]RIP|Bluray|BD[._ -]?(25|50)?|\bBR\b|Camrip|[._ -]\d{4}[._ -].+(720p|1080p|Cam|HDTS)|DIVX|[._ -]DVD[._ -]|DVD-?(5|9|R|Rip)|Untouched|VHSRip|XVID|[._ -](DTS|TVrip)[._ -]/i', $this->releaseName) && ! preg_match('/auto(cad|desk)|divx[._ -]plus|[._ -]exe$|[._ -](jav|XXX)[._ -]|SWE6RUS|\wXXX(1080p|720p|DVD)|Xilisoft/i', $this->releaseName)) {
287
+        if (preg_match('/[._ -]AVC|[._ -]|[BH][DR]RIP|Bluray|BD[._ -]?(25|50)?|\bBR\b|Camrip|[._ -]\d{4}[._ -].+(720p|1080p|Cam|HDTS)|DIVX|[._ -]DVD[._ -]|DVD-?(5|9|R|Rip)|Untouched|VHSRip|XVID|[._ -](DTS|TVrip)[._ -]/i', $this->releaseName) && !preg_match('/auto(cad|desk)|divx[._ -]plus|[._ -]exe$|[._ -](jav|XXX)[._ -]|SWE6RUS|\wXXX(1080p|720p|DVD)|Xilisoft/i', $this->releaseName)) {
288 288
             return match (true) {
289 289
                 $this->categorizeForeign && $this->isMovieForeign(), $this->isMovieDVD(), $this->isMovieX265(), $this->isMovieUHD(), $this->catWebDL && $this->isMovieWEBDL(), $this->isMovieSD(), $this->isMovie3D(), $this->isMovieBluRay(), $this->isMovieHD(), $this->isMovieOther() => true,
290 290
                 default => false,
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
     public function isMovieBluRay(): bool
347 347
     {
348 348
         if (preg_match('/bluray-|[._ -]bd?[._ -]?(25|50)|blu-ray|Bluray\s-\sUntouched|[._ -]untouched[._ -]/i', $this->releaseName)
349
-            && ! preg_match('/SecretUsenet\.com$/i', $this->releaseName)) {
349
+            && !preg_match('/SecretUsenet\.com$/i', $this->releaseName)) {
350 350
             $this->tmpCat = Category::MOVIE_BLURAY;
351 351
 
352 352
             return true;
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
 
374 374
     public function isMovieUHD(): bool
375 375
     {
376
-        if (! preg_match('/(S\d+).*(2160p).*(Netflix|Amazon).*(TrollUHD|NTb|VLAD)/i', $this->releaseName) && false !== stripos($this->releaseName, '2160p')) {
376
+        if (!preg_match('/(S\d+).*(2160p).*(Netflix|Amazon).*(TrollUHD|NTb|VLAD)/i', $this->releaseName) && false !== stripos($this->releaseName, '2160p')) {
377 377
             $this->tmpCat = Category::MOVIE_UHD;
378 378
 
379 379
             return true;
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
     public function isXxx(): bool
503 503
     {
504 504
         switch (true) {
505
-            case ! preg_match('/\bXXX\b|(a\.b\.erotica|ClubSeventeen|Cum(ming|shot)|Err?oticax?|Porn(o|lation)?|Imageset|PICTURESET|JAV Uncensored|lesb(ians?|os?)|mastur(bation|e?bate)|My_Stepfather_Made_Me|nympho?|OLDER ANGELS|pictures\.erotica\.anime|sexontv|slut|Squirt|SWE6RUS|Transsexual|whore)/i', $this->releaseName):
505
+            case !preg_match('/\bXXX\b|(a\.b\.erotica|ClubSeventeen|Cum(ming|shot)|Err?oticax?|Porn(o|lation)?|Imageset|PICTURESET|JAV Uncensored|lesb(ians?|os?)|mastur(bation|e?bate)|My_Stepfather_Made_Me|nympho?|OLDER ANGELS|pictures\.erotica\.anime|sexontv|slut|Squirt|SWE6RUS|Transsexual|whore)/i', $this->releaseName):
506 506
                 return false;
507 507
             case $this->isXxxPack():
508 508
             case $this->isXxxClipSD():
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 
528 528
     public function isXxx264(): bool
529 529
     {
530
-        if (preg_match('/720p|1080(hd|[ip])|[xh][^a-z0-9]?264/i', $this->releaseName) && ! preg_match('/\bwmv\b/i', $this->releaseName) && stripos($this->releaseName, 'SDX264XXX') === false) {
530
+        if (preg_match('/720p|1080(hd|[ip])|[xh][^a-z0-9]?264/i', $this->releaseName) && !preg_match('/\bwmv\b/i', $this->releaseName) && stripos($this->releaseName, 'SDX264XXX') === false) {
531 531
             $this->tmpCat = Category::XXX_X264;
532 532
 
533 533
             return true;
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
 
700 700
     public function isGame3DS(): bool
701 701
     {
702
-        if (preg_match('/\b3DS\b[^max]|[\._-]3ds|nintendo.+3ds|[_\.]3DS-/i', $this->releaseName) && ! preg_match('/3ds max/i', $this->releaseName) && preg_match('/(EUR|FR|GAME|HOL|JP|JPN|NL|NTSC|PAL|KS|USA|ASIA)/i', $this->releaseName)) {
702
+        if (preg_match('/\b3DS\b[^max]|[\._-]3ds|nintendo.+3ds|[_\.]3DS-/i', $this->releaseName) && !preg_match('/3ds max/i', $this->releaseName) && preg_match('/(EUR|FR|GAME|HOL|JP|JPN|NL|NTSC|PAL|KS|USA|ASIA)/i', $this->releaseName)) {
703 703
             $this->tmpCat = Category::GAME_3DS;
704 704
 
705 705
             return true;
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
     public function isMusic(): bool
903 903
     {
904 904
         return match (true) {
905
-            $this->isMusicVideo(), $this->isAudiobook(), $this->isMusicLossless(), $this->isMusicMP3(), $this->isMusicPodcast(),$this->isMusicOther() => true,
905
+            $this->isMusicVideo(), $this->isAudiobook(), $this->isMusicLossless(), $this->isMusicMP3(), $this->isMusicPodcast(), $this->isMusicOther() => true,
906 906
             default => false,
907 907
         };
908 908
     }
@@ -999,7 +999,7 @@  discard block
 block discarded – undo
999 999
     public function isMusicOther(): bool
1000 1000
     {
1001 1001
         if (preg_match('/(19|20)\d\d\-(C4)$|[._ -]\d?CD[._ -](19|20)\d\d|\(\d\-?CD\)|\-\dcd\-|\d[._ -]Albums|Albums.+(EP)|Bonus.+Tracks|Box.+?CD.+SET|Discography|D\.O\.M|Greatest\sSongs|Live.+(Bootleg|Remastered)|Music.+Vol|([\(\[\s])NMR([\)\]\s])|Promo.+CD|Reggaeton|Tiesto.+Club|Vinyl\s2496|\WV\.A\.|^\(VA\s|^VA[._ -]/i', $this->releaseName)) {
1002
-            if (! $this->isMusicForeign()) {
1002
+            if (!$this->isMusicForeign()) {
1003 1003
                 $this->tmpCat = Category::MUSIC_OTHER;
1004 1004
             }
1005 1005
 
@@ -1050,7 +1050,7 @@  discard block
 block discarded – undo
1050 1050
     public function isComic(): bool
1051 1051
     {
1052 1052
         switch (true) {
1053
-            case ! preg_match('/[\. ](cbr|cbz)|[\( ]c2c|cbr|cbz[\) ]|comix|^\(comic|[\.\-_\(\[ ]comics?[._ -]|comic.+book|covers.+digital|DC.+(Adventures|Universe)|digital.+(son|zone)|Graphic.+Novel|[\.\-_h ]manga|Total[._ -]Marvel/i', $this->releaseName):
1053
+            case !preg_match('/[\. ](cbr|cbz)|[\( ]c2c|cbr|cbz[\) ]|comix|^\(comic|[\.\-_\(\[ ]comics?[._ -]|comic.+book|covers.+digital|DC.+(Adventures|Universe)|digital.+(son|zone)|Graphic.+Novel|[\.\-_h ]manga|Total[._ -]Marvel/i', $this->releaseName):
1054 1054
                 return false;
1055 1055
             case $this->isBookForeign():
1056 1056
                 break;
@@ -1065,7 +1065,7 @@  discard block
 block discarded – undo
1065 1065
     public function isTechnicalBook(): bool
1066 1066
     {
1067 1067
         switch (true) {
1068
-            case ! preg_match('/^\(?(atz|bb|css|c ?t|Drawing|Gabler|IOS|Iphone|Lynda|Manning|Medic(al|ine)|MIT|No[._ -]Starch|Packt|Peachpit|Pragmatic|Revista|Servo|SmartBooks|Spektrum|Strata|Sybex|Syngress|Vieweg|Wiley|Woods|Wrox)[._ -]|[._ -](Ajax|CSS|DIY|Javascript|(My|Postgre)?SQL|XNA)[._ -]|3DS\.\-_ ]Max|Academic|Adobe|Algebra|Analysis|Appleworks|Archaeology|Bitdefender|Birkhauser|Britannica|[._ -]C\+\+|C[._ -](\+\+|Sharp|Plus)|Chemistry|Circuits|Cook(book|ing)|(Beginners?|Complete|Communications|Definitive|Essential|Hackers?|Practical|Professionals?)[._ -]Guide|Developer|Diagnostic|Disassembl(er|ing|y)|Debugg(er|ing)|Dreamweaver|Economics|Education|Electronics|Enc([iy])clopedia|Engineer(ing|s)|Essays|Exercizes|For.+Beginners|Focal[._ -]Press|For[._ -]Dummies|FreeBSD|Fundamentals[._ -]of[._ -]|(Galileo|Island)[._ -]Press|Geography|Grammar|Guide[._ -](For|To)|Hacking|Google|Handboo?k|How[._ -](It|To)|Intoduction[._ -]to|Iphone|jQuery|Lessons[._ -]In|Learning|LibreOffice|Linux|Manual|Marketing|Masonry|Mathematic(al|s)?|Medical|Microsoft|National[._ -]Academies|Nero[._ -]\d+|OReilly|OS[._ -]X[._ -]|Official[._ -]Guide|Open(GL|Office)|Pediatric|Periodic.+Table|Photoshop|Physics|Power(PC|Point|Shell)|Programm(ers?|ier||ing)|Raspberry.+Pi|Remedies|Service\s?Manual|SitePoint|Sketching|Statistics|Stock.+Market|Students|Theory|Training|Tutsplus|Ubuntu|Understanding[._ -](and|Of|The)|Visual[._ -]Studio|Textbook|VMWare|wii?max|Windows[._ -](8|7|Vista|XP)|^Wood[._ -]|Woodwork|WordPress|Work(book|shop)|Youtube/i', $this->releaseName):
1068
+            case !preg_match('/^\(?(atz|bb|css|c ?t|Drawing|Gabler|IOS|Iphone|Lynda|Manning|Medic(al|ine)|MIT|No[._ -]Starch|Packt|Peachpit|Pragmatic|Revista|Servo|SmartBooks|Spektrum|Strata|Sybex|Syngress|Vieweg|Wiley|Woods|Wrox)[._ -]|[._ -](Ajax|CSS|DIY|Javascript|(My|Postgre)?SQL|XNA)[._ -]|3DS\.\-_ ]Max|Academic|Adobe|Algebra|Analysis|Appleworks|Archaeology|Bitdefender|Birkhauser|Britannica|[._ -]C\+\+|C[._ -](\+\+|Sharp|Plus)|Chemistry|Circuits|Cook(book|ing)|(Beginners?|Complete|Communications|Definitive|Essential|Hackers?|Practical|Professionals?)[._ -]Guide|Developer|Diagnostic|Disassembl(er|ing|y)|Debugg(er|ing)|Dreamweaver|Economics|Education|Electronics|Enc([iy])clopedia|Engineer(ing|s)|Essays|Exercizes|For.+Beginners|Focal[._ -]Press|For[._ -]Dummies|FreeBSD|Fundamentals[._ -]of[._ -]|(Galileo|Island)[._ -]Press|Geography|Grammar|Guide[._ -](For|To)|Hacking|Google|Handboo?k|How[._ -](It|To)|Intoduction[._ -]to|Iphone|jQuery|Lessons[._ -]In|Learning|LibreOffice|Linux|Manual|Marketing|Masonry|Mathematic(al|s)?|Medical|Microsoft|National[._ -]Academies|Nero[._ -]\d+|OReilly|OS[._ -]X[._ -]|Official[._ -]Guide|Open(GL|Office)|Pediatric|Periodic.+Table|Photoshop|Physics|Power(PC|Point|Shell)|Programm(ers?|ier||ing)|Raspberry.+Pi|Remedies|Service\s?Manual|SitePoint|Sketching|Statistics|Stock.+Market|Students|Theory|Training|Tutsplus|Ubuntu|Understanding[._ -](and|Of|The)|Visual[._ -]Studio|Textbook|VMWare|wii?max|Windows[._ -](8|7|Vista|XP)|^Wood[._ -]|Woodwork|WordPress|Work(book|shop)|Youtube/i', $this->releaseName):
1069 1069
                 return false;
1070 1070
             case $this->isBookForeign():
1071 1071
                 break;
@@ -1080,7 +1080,7 @@  discard block
 block discarded – undo
1080 1080
     public function isMagazine(): bool
1081 1081
     {
1082 1082
         switch (true) {
1083
-            case ! preg_match('/[a-z\-\._ ][._ -](January|February|March|April|May|June|July|August|September|October|November|December)[._ -](\d{1,2},)?20\d\d[._ -]|^\(.+[ .]\d{1,2}[ .]20\d\d[ .].+\.scr|[._ -](Catalogue|FHM|NUTS|Pictorial|Tatler|XXX)[._ -]|^\(?(Allehanda|Club|Computer([a-z0-9]+)?|Connect \d+|Corriere|ct|Diario|Digit(al)?|Esquire|FHM|Gadgets|Galileo|Glam|GQ|Infosat|Inked|Instyle|io|Kicker|Liberation|New Scientist|NGV|Nuts|Popular|Professional|Reise|Sette(tv)?|Springer|Stuff|Studentlitteratur|Vegetarian|Vegetable|Videomarkt|Wired)[._ -]|Brady(.+)?Games|Catalog|Columbus.+Dispatch|Correspondenten|Corriere[._ -]Della[._ -]Sera|Cosmopolitan|Dagbladet|Digital[._ -]Guide|Economist|Eload ?24|ExtraTime|Fatto[._ -]Quotidiano|Flight[._ -](International|Journal)|Finanzwoche|France.+Football|Foto.+Video|Games?(Master|Markt|tar|TM)|Gardening|Gazzetta|Globe[._ -]And[._ -]Mail|Guitar|Heimkino|Hustler|La.+(Lettura|Rblica|Stampa)|Le[._ -](Monde|Temps)|Les[._ -]Echos|e?Magazin(es?)?|Mac(life|welt)|Marie.+Claire|Maxim|Men.+(Health|Fitness)|Motocross|Motorcycle|Mountain[._ -]Bike|MusikWoche|National[._ -]Geographic|New[._ -]Yorker|PC([._ -](Gamer|Welt|World)|Games|Go|Tip)|Penthouse|Photograph(er|ic)|Playboy|Posten|Quotidiano|(Golf|Readers?).+Digest|SFX[._ -]UK|Recipe(.+Guide|s)|SkyNews|Sport[._ -]?Week|Strategy.+Guide|TabletPC|Tattoo[._ -]Life|The[._ -]Guardian|Tageszeitung|Tid(bits|ning)|Top[._ -]Gear[._ -]|Total[._ -]Guitar|Travel[._ -]Guides?|Tribune[._ -]De[._ -]|US[._ -]Weekly|USA[._ -]Today|TruePDF|Vogue|Verlag|Warcraft|Web.+Designer|What[._ -]Car|Zeitung/i', $this->releaseName):
1083
+            case !preg_match('/[a-z\-\._ ][._ -](January|February|March|April|May|June|July|August|September|October|November|December)[._ -](\d{1,2},)?20\d\d[._ -]|^\(.+[ .]\d{1,2}[ .]20\d\d[ .].+\.scr|[._ -](Catalogue|FHM|NUTS|Pictorial|Tatler|XXX)[._ -]|^\(?(Allehanda|Club|Computer([a-z0-9]+)?|Connect \d+|Corriere|ct|Diario|Digit(al)?|Esquire|FHM|Gadgets|Galileo|Glam|GQ|Infosat|Inked|Instyle|io|Kicker|Liberation|New Scientist|NGV|Nuts|Popular|Professional|Reise|Sette(tv)?|Springer|Stuff|Studentlitteratur|Vegetarian|Vegetable|Videomarkt|Wired)[._ -]|Brady(.+)?Games|Catalog|Columbus.+Dispatch|Correspondenten|Corriere[._ -]Della[._ -]Sera|Cosmopolitan|Dagbladet|Digital[._ -]Guide|Economist|Eload ?24|ExtraTime|Fatto[._ -]Quotidiano|Flight[._ -](International|Journal)|Finanzwoche|France.+Football|Foto.+Video|Games?(Master|Markt|tar|TM)|Gardening|Gazzetta|Globe[._ -]And[._ -]Mail|Guitar|Heimkino|Hustler|La.+(Lettura|Rblica|Stampa)|Le[._ -](Monde|Temps)|Les[._ -]Echos|e?Magazin(es?)?|Mac(life|welt)|Marie.+Claire|Maxim|Men.+(Health|Fitness)|Motocross|Motorcycle|Mountain[._ -]Bike|MusikWoche|National[._ -]Geographic|New[._ -]Yorker|PC([._ -](Gamer|Welt|World)|Games|Go|Tip)|Penthouse|Photograph(er|ic)|Playboy|Posten|Quotidiano|(Golf|Readers?).+Digest|SFX[._ -]UK|Recipe(.+Guide|s)|SkyNews|Sport[._ -]?Week|Strategy.+Guide|TabletPC|Tattoo[._ -]Life|The[._ -]Guardian|Tageszeitung|Tid(bits|ning)|Top[._ -]Gear[._ -]|Total[._ -]Guitar|Travel[._ -]Guides?|Tribune[._ -]De[._ -]|US[._ -]Weekly|USA[._ -]Today|TruePDF|Vogue|Verlag|Warcraft|Web.+Designer|What[._ -]Car|Zeitung/i', $this->releaseName):
1084 1084
                 return false;
1085 1085
             case $this->isBookForeign():
1086 1086
                 break;
@@ -1106,7 +1106,7 @@  discard block
 block discarded – undo
1106 1106
     public function isEBook(): bool
1107 1107
     {
1108 1108
         switch (true) {
1109
-            case ! preg_match('/^ePub|[._ -](Ebook|E?\-book|\) WW|Publishing)|[\.\-_\(\[ ](azw|epub|html|mobi|pdf|rtf|tif|txt)[\.\-_\)\] ]|[\. ](azw|doc|epub|mobi|pdf)(?![\w .])|\.ebook-\w$/i', $this->releaseName):
1109
+            case !preg_match('/^ePub|[._ -](Ebook|E?\-book|\) WW|Publishing)|[\.\-_\(\[ ](azw|epub|html|mobi|pdf|rtf|tif|txt)[\.\-_\)\] ]|[\. ](azw|doc|epub|mobi|pdf)(?![\w .])|\.ebook-\w$/i', $this->releaseName):
1110 1110
                 return false;
1111 1111
             case $this->isBookForeign():
1112 1112
                 break;
Please login to merge, or discard this patch.
Blacklight/Tmux.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
     {
281 281
         $returnVal = shell_exec("which $cmd 2>/dev/null");
282 282
 
283
-        return ! empty($returnVal);
283
+        return !empty($returnVal);
284 284
     }
285 285
 
286 286
     /**
@@ -339,11 +339,11 @@  discard block
 block discarded – undo
339 339
 
340 340
             case 2:
341 341
                 $ppminString = $ppmaxString = '';
342
-                if (is_numeric($ppmax) && ! empty($ppmax)) {
342
+                if (is_numeric($ppmax) && !empty($ppmax)) {
343 343
                     $ppmax *= 1073741824;
344 344
                     $ppmaxString = "AND r.size < {$ppmax}";
345 345
                 }
346
-                if (is_numeric($ppmin) && ! empty($ppmin)) {
346
+                if (is_numeric($ppmin) && !empty($ppmin)) {
347 347
                     $ppmin *= 1048576;
348 348
                     $ppminString = "AND r.size > {$ppmin}";
349 349
                 }
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
             throw new \RuntimeException('Tmux\\\'s running flag was not found in the database.'.PHP_EOL.'Please check the tables are correctly setup.'.PHP_EOL);
402 402
         }
403 403
 
404
-        return ! ((int) $running->value === 0);
404
+        return !((int) $running->value === 0);
405 405
     }
406 406
 
407 407
     /**
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
      */
428 428
     public function startRunning(): void
429 429
     {
430
-        if (! $this->isRunning()) {
430
+        if (!$this->isRunning()) {
431 431
             Settings::query()->where(['section' => 'site', 'subsection' => 'tmux', 'setting' => 'running'])->update(['value' => 1]);
432 432
         }
433 433
     }
Please login to merge, or discard this patch.
app/Http/Requests/Auth/RegisterRegisterRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
      */
12 12
     public function rules(): array
13 13
     {
14
-        if (config('captcha.enabled') === true && (! empty(config('captcha.secret')) && ! empty(config('captcha.sitekey')))) {
14
+        if (config('captcha.enabled') === true && (!empty(config('captcha.secret')) && !empty(config('captcha.sitekey')))) {
15 15
             return [
16 16
                 'g-recaptcha-response' => [
17 17
                     'required',
Please login to merge, or discard this patch.
app/Models/User.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
     {
251 251
         $res = self::query()->where('email', '<>', '[email protected]');
252 252
 
253
-        if (! empty($role)) {
253
+        if (!empty($role)) {
254 254
             $res->where('roles_id', $role);
255 255
         }
256 256
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
             'rate_limit' => $rateLimit ? $rateLimit['rate_limit'] : 60,
292 292
         ];
293 293
 
294
-        if (! empty($email)) {
294
+        if (!empty($email)) {
295 295
             $email = trim($email);
296 296
             $sql += ['email' => $email];
297 297
         }
@@ -336,10 +336,10 @@  discard block
 block discarded – undo
336 336
     {
337 337
         $user = self::find($uid);
338 338
         $currRoleExp = $user->rolechangedate ?? now()->toDateTimeString();
339
-        if (! empty($date)) {
339
+        if (!empty($date)) {
340 340
             $user->update(['rolechangedate' => $date]);
341 341
         }
342
-        if (empty($date) && ! empty($addYear)) {
342
+        if (empty($date) && !empty($addYear)) {
343 343
             $user->update(['rolechangedate' => Carbon::createFromDate($currRoleExp)->addYears($addYear)]);
344 344
         }
345 345
     }
@@ -396,10 +396,10 @@  discard block
 block discarded – undo
396 396
         return self::fromQuery(
397 397
             sprintf(
398 398
                 $query,
399
-                ! empty($userName) ? 'AND users.username '.'LIKE '.escapeString('%'.$userName.'%') : '',
400
-                ! empty($email) ? 'AND users.email '.'LIKE '.escapeString('%'.$email.'%') : '',
401
-                ! empty($host) ? 'AND users.host '.'LIKE '.escapeString('%'.$host.'%') : '',
402
-                (! empty($role) ? ('AND users.roles_id = '.$role) : ''),
399
+                !empty($userName) ? 'AND users.username '.'LIKE '.escapeString('%'.$userName.'%') : '',
400
+                !empty($email) ? 'AND users.email '.'LIKE '.escapeString('%'.$email.'%') : '',
401
+                !empty($host) ? 'AND users.host '.'LIKE '.escapeString('%'.$host.'%') : '',
402
+                (!empty($role) ? ('AND users.roles_id = '.$role) : ''),
403 403
                 $order[0],
404 404
                 $order[1],
405 405
                 ($start === false ? '' : ('LIMIT '.$offset.' OFFSET '.$start))
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 
512 512
     public static function isValidUrl($url): bool
513 513
     {
514
-        return (! preg_match('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i', $url)) ? false : true;
514
+        return (!preg_match('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i', $url)) ? false : true;
515 515
     }
516 516
 
517 517
     /**
@@ -547,7 +547,7 @@  discard block
 block discarded – undo
547 547
 
548 548
         // Make sure this is the last check, as if a further validation check failed, the invite would still have been used up.
549 549
         $invitedBy = 0;
550
-        if (! $forceInviteMode && (int) Settings::settingValue('..registerstatus') === Settings::REGISTER_STATUS_INVITE) {
550
+        if (!$forceInviteMode && (int) Settings::settingValue('..registerstatus') === Settings::REGISTER_STATUS_INVITE) {
551 551
             if ($inviteCode === '') {
552 552
                 return self::ERR_SIGNUP_BADINVITECODE;
553 553
             }
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
     public static function checkAndUseInvite(string $inviteCode): int
568 568
     {
569 569
         $invite = Invitation::getInvite($inviteCode);
570
-        if (! $invite) {
570
+        if (!$invite) {
571 571
             return -1;
572 572
         }
573 573
 
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
     public static function add(string $userName, string $password, string $email, int $role, ?string $notes = '', string $host = '', int $invites = Invitation::DEFAULT_INVITES, int $invitedBy = 0)
584 584
     {
585 585
         $password = self::hashPassword($password);
586
-        if (! $password) {
586
+        if (!$password) {
587 587
             return false;
588 588
         }
589 589
 
@@ -625,9 +625,9 @@  discard block
 block discarded – undo
625 625
 
626 626
         $cats = ['view console', 'view movies', 'view audio', 'view tv', 'view pc', 'view adult', 'view books', 'view other'];
627 627
 
628
-        if (! empty($allowed)) {
628
+        if (!empty($allowed)) {
629 629
             foreach ($cats as $cat) {
630
-                if (! \in_array($cat, $allowed, false)) {
630
+                if (!\in_array($cat, $allowed, false)) {
631 631
                     switch ($cat) {
632 632
                         case 'view console':
633 633
                             $ret[] = 1000;
Please login to merge, or discard this patch.