Passed
Pull Request — master (#1384)
by
unknown
12:21 queued 06:04
created
Blacklight/NameFixer.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -830,7 +830,7 @@  discard block
 block discarded – undo
830 830
                 $this->matched = true;
831 831
                 $this->relid = (int) $release->releases_id;
832 832
 
833
-                $determinedCategory = $this->category->determineCategory($release->groups_id, $newName, ! empty($release->fromname) ? $release->fromname : '');
833
+                $determinedCategory = $this->category->determineCategory($release->groups_id, $newName, !empty($release->fromname) ? $release->fromname : '');
834 834
 
835 835
                 if ($type === 'PAR2, ') {
836 836
                     $newName = ucwords($newName);
@@ -871,7 +871,7 @@  discard block
 block discarded – undo
871 871
                         $this->colorCLI->info($type.$method).
872 872
                         $this->colorCLI->headerOver('Releases ID: ').
873 873
                         $this->colorCLI->info($release->releases_id);
874
-                    if (! empty($release->filename)) {
874
+                    if (!empty($release->filename)) {
875 875
                         $this->colorCLI->headerOver('Filename:  ').
876 876
                             $this->colorCLI->info($release->filename);
877 877
                     }
@@ -1077,7 +1077,7 @@  discard block
 block discarded – undo
1077 1077
 
1078 1078
         if (\strlen($preTitle) >= 15 && preg_match(self::PREDB_REGEX, $preTitle)) {
1079 1079
             $titleMatch = $this->manticore->searchIndexes('releases_rt', $preTitle, ['name', 'searchname', 'filename']);
1080
-            if (! empty($titleMatch)) {
1080
+            if (!empty($titleMatch)) {
1081 1081
                 $join = implode(',', Arr::get($titleMatch, 'id'));
1082 1082
             }
1083 1083
         }
@@ -1174,9 +1174,9 @@  discard block
 block discarded – undo
1174 1174
                 } else {
1175 1175
                     $results = Arr::get($this->manticore->searchIndexes('predb_rt', $preMatch[1], ['filename', 'title']), 'data');
1176 1176
                 }
1177
-                if (! empty($results)) {
1177
+                if (!empty($results)) {
1178 1178
                     foreach ($results as $result) {
1179
-                        if (! empty($result)) {
1179
+                        if (!empty($result)) {
1180 1180
                             $preFtMatch = $this->preMatch($result['filename']);
1181 1181
                             if ($preFtMatch[0] === true) {
1182 1182
                                 $this->_fileName = $result['filename'];
@@ -1206,7 +1206,7 @@  discard block
 block discarded – undo
1206 1206
         // first strip all non-printing chars  from filename
1207 1207
         $this->_fileName = str_replace('/[[:^print:]]/', '', $this->_fileName);
1208 1208
 
1209
-        if ($this->_fileName !== '' && ! str_starts_with($this->_fileName, '.')) {
1209
+        if ($this->_fileName !== '' && !str_starts_with($this->_fileName, '.')) {
1210 1210
             $this->_fileName = match (true) {
1211 1211
                 str_contains($this->_fileName, '.') => Str::beforeLast('.', $this->_fileName),
1212 1212
                 preg_match('/\.part\d+$/', $this->_fileName) => Str::beforeLast('.', $this->_fileName),
@@ -1252,7 +1252,7 @@  discard block
 block discarded – undo
1252 1252
         );
1253 1253
 
1254 1254
         foreach ($row as $item) {
1255
-            if (! empty($item)) {
1255
+            if (!empty($item)) {
1256 1256
                 if ($item->title !== $release->searchname) {
1257 1257
                     $this->updateRelease($release, $item->title, 'predb hash release name: '.$item->source, $echo, $hashtype, $nameStatus, $show, $item->predb_id);
1258 1258
                     $matching++;
@@ -1337,7 +1337,7 @@  discard block
 block discarded – undo
1337 1337
     {
1338 1338
 
1339 1339
         // Get pre style name from releases.name
1340
-        if (preg_match_all(self::PREDB_REGEX, $release->textstring, $hits) && ! preg_match('/Source\s\:/i', $release->textstring)) {
1340
+        if (preg_match_all(self::PREDB_REGEX, $release->textstring, $hits) && !preg_match('/Source\s\:/i', $release->textstring)) {
1341 1341
             foreach ($hits as $hit) {
1342 1342
                 foreach ($hit as $val) {
1343 1343
                     $title = Predb::query()->where('title', trim($val))->select(['title', 'id'])->first();
@@ -1350,7 +1350,7 @@  discard block
 block discarded – undo
1350 1350
         }
1351 1351
 
1352 1352
         // if only processing for PreDB match skip to return
1353
-        if (! $preId) {
1353
+        if (!$preId) {
1354 1354
             switch ($type) {
1355 1355
                 case 'PAR2, ':
1356 1356
                     $this->fileCheck($release, $echo, $type, $nameStatus, $show);
@@ -1390,7 +1390,7 @@  discard block
 block discarded – undo
1390 1390
             }
1391 1391
 
1392 1392
             // set NameFixer process flags after run
1393
-            if ($nameStatus === true && ! $this->matched) {
1393
+            if ($nameStatus === true && !$this->matched) {
1394 1394
                 switch ($type) {
1395 1395
                     case 'NFO, ':
1396 1396
                         $this->_updateSingleColumn('proc_nfo', self::PROC_NFO_DONE, $release->releases_id);
@@ -1440,7 +1440,7 @@  discard block
 block discarded – undo
1440 1440
 
1441 1441
         $result = [];
1442 1442
 
1443
-        if (! $this->done && $this->relid !== (int) $release->releases_id) {
1443
+        if (!$this->done && $this->relid !== (int) $release->releases_id) {
1444 1444
             if (preg_match('/\w[\-\w.\',;& ]+((s\d{1,2}[._ -]?[bde]\d{1,2})|(?<!\d)[S|]\d{1,2}[E|x]\d{1,}(?!\d)|ep[._ -]?\d{2})[\-\w.\',;.()]+(BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -][\-\w.\',;& ]+\w/i', $release->textstring, $result)) {
1445 1445
                 $this->updateRelease($release, $result['0'], 'tvCheck: Title.SxxExx.Text.source.group', $echo, $type, $nameStatus, $show);
1446 1446
             } elseif (preg_match('/\w[\-\w.\',;& ]+((s\d{1,2}[._ -]?[bde]\d{1,2})|\d{1,2}x\d{2}|ep[._ -]?\d{2})[\-\w.\',;& ]+((19|20)\d\d)[\-\w.\',;& ]+\w/i', $release->textstring, $result)) {
@@ -1470,7 +1470,7 @@  discard block
 block discarded – undo
1470 1470
 
1471 1471
         $result = [];
1472 1472
 
1473
-        if (! $this->done && $this->relid !== (int) $release->releases_id) {
1473
+        if (!$this->done && $this->relid !== (int) $release->releases_id) {
1474 1474
             if (preg_match('/\w[\-\w.\',;& ]+((19|20)\d\d)[\-\w.\',;& ]+(480|720|1080)[ip][._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[\-\w.\',;& ]+\w/i', $release->textstring, $result)) {
1475 1475
                 $this->updateRelease($release, $result['0'], 'movieCheck: Title.year.Text.res.vcod.group', $echo, $type, $nameStatus, $show);
1476 1476
             } elseif (preg_match('/\w[\-\w.\',;& ]+((19|20)\d\d)[._ -](BD(-?(25|50|RIP))?|Blu-?Ray ?(3D)?|BRRIP|CAM(RIP)?|DBrip|DTV|DVD\-?(5|9|(R(IP)?|scr(eener)?))?|[HPS]D?(RIP|TV(RIP)?)?|NTSC|PAL|R5|Ripped |S?VCD|scr(eener)?|SAT(RIP)?|TS|VHS(RIP)?|VOD|WEB-DL)[._ -](DivX|[HX][._ -]?264|MPEG2|XviD(HD)?|WMV)[._ -](480|720|1080)[ip][\-\w.\',;& ]+\w/i', $release->textstring, $result)) {
@@ -1512,7 +1512,7 @@  discard block
 block discarded – undo
1512 1512
 
1513 1513
         $result = [];
1514 1514
 
1515
-        if (! $this->done && $this->relid !== (int) $release->releases_id) {
1515
+        if (!$this->done && $this->relid !== (int) $release->releases_id) {
1516 1516
             if (preg_match('/\w[\-\w.\',;& ]+(ASIA|DLC|EUR|GOTY|JPN|KOR|MULTI\d{1}|NTSCU?|PAL|RF|Region[._ -]?Free|USA|XBLA)[._ -](DLC[._ -]Complete|FRENCH|GERMAN|MULTI\d{1}|PROPER|PSN|READ[._ -]?NFO|UMD)?[._ -]?(GC|NDS|NGC|PS3|PSP|WII|XBOX(360)?)[\-\w.\',;& ]+\w/i', $release->textstring, $result)) {
1517 1517
                 $this->updateRelease($release, $result['0'], 'gameCheck: Videogames 1', $echo, $type, $nameStatus, $show);
1518 1518
             } elseif (preg_match('/\w[\-\w.\',;& ]+(GC|NDS|NGC|PS3|WII|XBOX(360)?)[._ -](DUPLEX|iNSOMNi|OneUp|STRANGE|SWAG|SKY)[\-\w.\',;& ]+\w/i', $release->textstring, $result)) {
@@ -1538,7 +1538,7 @@  discard block
 block discarded – undo
1538 1538
 
1539 1539
         $result = [];
1540 1540
 
1541
-        if (! $this->done && $this->relid !== (int) $release->releases_id) {
1541
+        if (!$this->done && $this->relid !== (int) $release->releases_id) {
1542 1542
             if (preg_match('/\w[\-\w.\',;& ]+(\d{1,10}|Linux|UNIX)[._ -](RPM)?[._ -]?(X64)?[._ -]?(Incl)[._ -](Keygen)[\-\w.\',;& ]+\w/i', $release->textstring, $result)) {
1543 1543
                 $this->updateRelease($release, $result['0'], 'appCheck: Apps 1', $echo, $type, $nameStatus, $show);
1544 1544
             } elseif (preg_match('/\w[\-\w.\',;& ]+\d{1,8}[._ -](winall-freeware)[\-\w.\',;& ]+\w/i', $release->textstring, $result)) {
@@ -1558,7 +1558,7 @@  discard block
 block discarded – undo
1558 1558
 
1559 1559
         $result = [];
1560 1560
 
1561
-        if (! $this->done && $this->relid !== (int) $release->releases_id) {
1561
+        if (!$this->done && $this->relid !== (int) $release->releases_id) {
1562 1562
             if (preg_match('/:\s*.*[\\\\\/]([A-Z0-9].+?S\d+[.-_ ]?[ED]\d+.+?)\.\w{2,}\s+/i', $release->textstring, $result)) {
1563 1563
                 $this->updateRelease($release, $result['1'], 'nfoCheck: Generic TV 1', $echo, $type, $nameStatus, $show);
1564 1564
             } elseif (preg_match('/(?:(\:\s{1,}))(.+?S\d{1,3}[.-_ ]?[ED]\d{1,3}.+?)(\s{2,}|\r|\n)/i', $release->textstring, $result)) {
@@ -1578,7 +1578,7 @@  discard block
 block discarded – undo
1578 1578
 
1579 1579
         $result = [];
1580 1580
 
1581
-        if (! $this->done && $this->relid !== (int) $release->releases_id) {
1581
+        if (!$this->done && $this->relid !== (int) $release->releases_id) {
1582 1582
             if (preg_match('/(?:((?!Source\s)\:\s{1,}))(.+?(19|20)\d\d.+?(BDRip|bluray|DVD(R|Rip)?|XVID).+?)(\s{2,}|\r|\n)/i', $release->textstring, $result)) {
1583 1583
                 $this->updateRelease($release, $result['2'], 'nfoCheck: Generic Movies 1', $echo, $type, $nameStatus, $show);
1584 1584
             } elseif (preg_match('/(?:(\s{2,}))((?!Source).+?[\.\-_ ](19|20)\d\d.+?(BDRip|bluray|DVD(R|Rip)?|XVID).+?)(\s{2,}|\r|\n)/i', $release->textstring, $result)) {
@@ -1597,7 +1597,7 @@  discard block
 block discarded – undo
1597 1597
 
1598 1598
         $result = [];
1599 1599
 
1600
-        if (! $this->done && $this->relid !== (int) $release->releases_id && preg_match('/(?:\s{2,})(.+?-FM-\d{2}-\d{2})/i', $release->textstring, $result)) {
1600
+        if (!$this->done && $this->relid !== (int) $release->releases_id && preg_match('/(?:\s{2,})(.+?-FM-\d{2}-\d{2})/i', $release->textstring, $result)) {
1601 1601
             $newName = str_replace('-FM-', '-FM-Radio-MP3-', $result['1']);
1602 1602
             $this->updateRelease($release, $newName, 'nfoCheck: Music FM RADIO', $echo, $type, $nameStatus, $show);
1603 1603
         }
@@ -1614,7 +1614,7 @@  discard block
 block discarded – undo
1614 1614
 
1615 1615
         $result = [];
1616 1616
 
1617
-        if (! $this->done && $this->relid !== (int) $release->releases_id && preg_match('/(\w[\-\w`~!@#$%^&*()_+={}|"<>?\[\]\\;\',.\/ ]+\s?\((19|20)\d\d\))/i', $release->textstring, $result) && ! preg_match('/\.pdf|Audio ?Book/i', $release->textstring)) {
1617
+        if (!$this->done && $this->relid !== (int) $release->releases_id && preg_match('/(\w[\-\w`~!@#$%^&*()_+={}|"<>?\[\]\\;\',.\/ ]+\s?\((19|20)\d\d\))/i', $release->textstring, $result) && !preg_match('/\.pdf|Audio ?Book/i', $release->textstring)) {
1618 1618
             $releaseName = $result[0];
1619 1619
             if (preg_match('/(idiomas|lang|language|langue|sprache).*?\b(?P<lang>Brazilian|Chinese|Croatian|Danish|DE|Deutsch|Dutch|Estonian|ES|English|Englisch|Finnish|Flemish|Francais|French|FR|German|Greek|Hebrew|Icelandic|Italian|Japenese|Japan|Japanese|Korean|Latin|Nordic|Norwegian|Polish|Portuguese|Russian|Serbian|Slovenian|Swedish|Spanisch|Spanish|Thai|Turkish)\b/i', $release->textstring, $result)) {
1620 1620
                 switch ($result['lang']) {
@@ -1787,7 +1787,7 @@  discard block
 block discarded – undo
1787 1787
 
1788 1788
         $result = [];
1789 1789
 
1790
-        if (! $this->done && $this->relid !== (int) $release->releases_id) {
1790
+        if (!$this->done && $this->relid !== (int) $release->releases_id) {
1791 1791
             if (preg_match('/ALiAS|BAT-TEAM|FAiRLiGHT|Game Type|Glamoury|HI2U|iTWINS|JAGUAR|(LARGE|MEDIUM)ISO|MAZE|nERv|PROPHET|PROFiT|PROCYON|RELOADED|REVOLVER|ROGUE|ViTALiTY/i', $release->textstring)) {
1792 1792
                 if (preg_match('/\w[\w.+&*\/\()\',;: -]+\(c\)[\-\w.\',;& ]+\w/i', $release->textstring, $result)) {
1793 1793
                     $releaseName = str_replace(['(c)', '(C)'], '(GAMES) (c)', $result['0']);
@@ -1811,7 +1811,7 @@  discard block
 block discarded – undo
1811 1811
     public function nfoCheckMisc($release, bool $echo, string $type, $nameStatus, $show): void
1812 1812
     {
1813 1813
 
1814
-        if (! $this->done && $this->relid !== (int) $release->releases_id) {
1814
+        if (!$this->done && $this->relid !== (int) $release->releases_id) {
1815 1815
             if (preg_match('/Supplier.+?IGUANA/i', $release->textstring)) {
1816 1816
                 $releaseName = '';
1817 1817
                 $result = [];
@@ -1850,7 +1850,7 @@  discard block
 block discarded – undo
1850 1850
 
1851 1851
         $result = [];
1852 1852
 
1853
-        if (! $this->done && $this->relid !== (int) $release->releases_id) {
1853
+        if (!$this->done && $this->relid !== (int) $release->releases_id) {
1854 1854
             switch (true) {
1855 1855
                 case preg_match('/^(.+?(x264|XviD)\-TVP)\\\\/i', $release->textstring, $result):
1856 1856
                     $this->updateRelease($release, $result['1'], 'fileCheck: TVP', $echo, $type, $nameStatus, $show);
@@ -1942,7 +1942,7 @@  discard block
 block discarded – undo
1942 1942
     public function uidCheck($release, $echo, $type, $nameStatus, $show): bool
1943 1943
     {
1944 1944
 
1945
-        if (! empty($release->uid) && ! $this->done && $this->relid !== (int) $release->releases_id) {
1945
+        if (!empty($release->uid) && !$this->done && $this->relid !== (int) $release->releases_id) {
1946 1946
             $result = Release::fromQuery(sprintf(
1947 1947
                 '
1948 1948
 				SELECT r.id AS releases_id, r.size AS relsize, r.name AS textstring, r.searchname, r.fromname, r.predb_id
@@ -1991,7 +1991,7 @@  discard block
 block discarded – undo
1991 1991
     {
1992 1992
 
1993 1993
         $newName = '';
1994
-        if (! $this->done && $this->relid !== (int) $release->releases_id) {
1994
+        if (!$this->done && $this->relid !== (int) $release->releases_id) {
1995 1995
             if (preg_match('/<Movie_name>(.+)<\/Movie_name>/i', $release->mediainfo, $hit)) {
1996 1996
                 $media = $hit[1];
1997 1997
                 if (preg_match(self::PREDB_REGEX, $media, $hit)) {
@@ -2024,7 +2024,7 @@  discard block
 block discarded – undo
2024 2024
     public function xxxNameCheck($release, $echo, $type, $nameStatus, $show): bool
2025 2025
     {
2026 2026
 
2027
-        if (! $this->done && $this->relid !== (int) $release->releases_id) {
2027
+        if (!$this->done && $this->relid !== (int) $release->releases_id) {
2028 2028
             $result = Release::fromQuery(
2029 2029
                 sprintf(
2030 2030
                     "
@@ -2072,7 +2072,7 @@  discard block
 block discarded – undo
2072 2072
     public function srrNameCheck($release, $echo, $type, $nameStatus, $show): bool
2073 2073
     {
2074 2074
 
2075
-        if (! $this->done && $this->relid !== (int) $release->releases_id) {
2075
+        if (!$this->done && $this->relid !== (int) $release->releases_id) {
2076 2076
             $result = Release::fromQuery(
2077 2077
                 sprintf(
2078 2078
                     "
@@ -2120,7 +2120,7 @@  discard block
 block discarded – undo
2120 2120
     public function hashCheck($release, $echo, $type, $nameStatus, $show): bool
2121 2121
     {
2122 2122
 
2123
-        if (! $this->done && $this->relid !== (int) $release->releases_id) {
2123
+        if (!$this->done && $this->relid !== (int) $release->releases_id) {
2124 2124
             $result = Release::fromQuery(sprintf(
2125 2125
                 '
2126 2126
 				SELECT r.id AS releases_id, r.size AS relsize, r.name AS textstring, r.searchname, r.fromname, r.predb_id
@@ -2166,7 +2166,7 @@  discard block
 block discarded – undo
2166 2166
     public function crcCheck($release, $echo, $type, $nameStatus, $show): bool
2167 2167
     {
2168 2168
 
2169
-        if (! $this->done && $this->relid !== (int) $release->releases_id && $release->textstring !== '') {
2169
+        if (!$this->done && $this->relid !== (int) $release->releases_id && $release->textstring !== '') {
2170 2170
             $result = Release::fromQuery(
2171 2171
                 sprintf(
2172 2172
                     '
@@ -2227,11 +2227,11 @@  discard block
 block discarded – undo
2227 2227
         $this->_fileName = $release->textstring;
2228 2228
         $this->_cleanMatchFiles();
2229 2229
         $this->cleanFileNames();
2230
-        if (! empty($this->_fileName)) {
2230
+        if (!empty($this->_fileName)) {
2231 2231
             if (config('nntmux.elasticsearch_enabled') === true) {
2232 2232
                 $results = $this->elasticsearch->searchPreDb($this->_fileName);
2233 2233
                 foreach ($results as $hit) {
2234
-                    if (! empty($hit)) {
2234
+                    if (!empty($hit)) {
2235 2235
                         $this->updateRelease($release, $hit['title'], 'PreDb: Filename match', $echo, $type, $nameStatus, $show, $hit['id']);
2236 2236
 
2237 2237
                         return true;
@@ -2239,9 +2239,9 @@  discard block
 block discarded – undo
2239 2239
                 }
2240 2240
             } else {
2241 2241
                 $predbSearch = Arr::get($this->manticore->searchIndexes('predb_rt', $this->_fileName, ['filename', 'title']), 'data');
2242
-                if (! empty($predbSearch)) {
2242
+                if (!empty($predbSearch)) {
2243 2243
                     foreach ($predbSearch as $hit) {
2244
-                        if (! empty($hit)) {
2244
+                        if (!empty($hit)) {
2245 2245
                             $this->updateRelease($release, $hit['title'], 'PreDb: Filename match', $echo, $type, $nameStatus, $show);
2246 2246
 
2247 2247
                             return true;
@@ -2263,11 +2263,11 @@  discard block
 block discarded – undo
2263 2263
         $this->_fileName = $release->textstring;
2264 2264
         $this->_cleanMatchFiles();
2265 2265
         $this->cleanFileNames();
2266
-        if (! empty($this->_fileName)) {
2266
+        if (!empty($this->_fileName)) {
2267 2267
             if (config('nntmux.elasticsearch_enabled') === true) {
2268 2268
                 $results = $this->elasticsearch->searchPreDb($this->_fileName);
2269 2269
                 foreach ($results as $hit) {
2270
-                    if (! empty($hit)) {
2270
+                    if (!empty($hit)) {
2271 2271
                         $this->updateRelease($release, $hit['title'], 'PreDb: Title match', $echo, $type, $nameStatus, $show, $hit['id']);
2272 2272
 
2273 2273
                         return true;
@@ -2275,9 +2275,9 @@  discard block
 block discarded – undo
2275 2275
                 }
2276 2276
             } else {
2277 2277
                 $results = Arr::get($this->manticore->searchIndexes('predb_rt', $this->_fileName, ['title']), 'data');
2278
-                if (! empty($results)) {
2278
+                if (!empty($results)) {
2279 2279
                     foreach ($results as $hit) {
2280
-                        if (! empty($hit)) {
2280
+                        if (!empty($hit)) {
2281 2281
                             $this->updateRelease($release, $hit['title'], 'PreDb: Title match', $echo, $type, $nameStatus, $show);
2282 2282
 
2283 2283
                             return true;
@@ -2293,10 +2293,10 @@  discard block
 block discarded – undo
2293 2293
     private function cleanFileNames(): array|string|null
2294 2294
     {
2295 2295
         if (preg_match('/(\.[a-zA-Z]{2})?(\.4k|\.fullhd|\.hd|\.int|\.\d+)?$/i', $this->_fileName, $hit)) {
2296
-            if (! empty($hit[1]) && preg_match('/\.[a-zA-Z]{2}/i', $hit[1])) {
2296
+            if (!empty($hit[1]) && preg_match('/\.[a-zA-Z]{2}/i', $hit[1])) {
2297 2297
                 $this->_fileName = preg_replace('/\.[a-zA-Z]{2}\./i', '.', $this->_fileName);
2298 2298
             }
2299
-            if (! empty($hit[2])) {
2299
+            if (!empty($hit[2])) {
2300 2300
                 if (preg_match('/\.4k$/', $hit[2])) {
2301 2301
                     $this->_fileName = preg_replace('/\.4k$/', '.2160p', $this->_fileName);
2302 2302
                 }
Please login to merge, or discard this patch.
Blacklight/Games.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     {
299 299
         $browseBy = ' ';
300 300
         foreach ($this->getBrowseByOptions() as $bbk => $bbv) {
301
-            if (! empty($_REQUEST[$bbk])) {
301
+            if (!empty($_REQUEST[$bbk])) {
302 302
                 $bbs = stripslashes($_REQUEST[$bbk]);
303 303
                 if ($bbk === 'year') {
304 304
                     $browseBy .= ' AND YEAR (gi.releasedate) '.'LIKE '.escapeString('%'.$bbs.'%');
@@ -362,11 +362,11 @@  discard block
 block discarded – undo
362 362
                 if (empty($this->_gameResults['title'])) {
363 363
                     return false;
364 364
                 }
365
-                if (! empty($this->_gameResults['cover'])) {
365
+                if (!empty($this->_gameResults['cover'])) {
366 366
                     $game['coverurl'] = (string) $this->_gameResults['cover'];
367 367
                 }
368 368
 
369
-                if (! empty($this->_gameResults['backdrop'])) {
369
+                if (!empty($this->_gameResults['backdrop'])) {
370 370
                     $game['backdropurl'] = (string) $this->_gameResults['backdrop'];
371 371
                 }
372 372
 
@@ -374,41 +374,41 @@  discard block
 block discarded – undo
374 374
                 $game['asin'] = $this->_gameResults['steamid'];
375 375
                 $game['url'] = (string) $this->_gameResults['directurl'];
376 376
 
377
-                if (! empty($this->_gameResults['publisher'])) {
377
+                if (!empty($this->_gameResults['publisher'])) {
378 378
                     $game['publisher'] = (string) $this->_gameResults['publisher'];
379 379
                 } else {
380 380
                     $game['publisher'] = 'Unknown';
381 381
                 }
382 382
 
383
-                if (! empty($this->_gameResults['rating'])) {
383
+                if (!empty($this->_gameResults['rating'])) {
384 384
                     $game['esrb'] = (string) $this->_gameResults['rating'];
385 385
                 } else {
386 386
                     $game['esrb'] = 'Not Rated';
387 387
                 }
388 388
 
389
-                if (! empty($this->_gameResults['releasedate'])) {
389
+                if (!empty($this->_gameResults['releasedate'])) {
390 390
                     $dateReleased = strtotime($this->_gameResults['releasedate']) === false ? '' : $this->_gameResults['releasedate'];
391 391
                     $game['releasedate'] = ($this->_gameResults['releasedate'] === '' || strtotime($this->_gameResults['releasedate']) === false) ? null : Carbon::createFromFormat('M j, Y', Carbon::parse($dateReleased)->toFormattedDateString())->format('Y-m-d');
392 392
                 }
393 393
 
394
-                if (! empty($this->_gameResults['description'])) {
394
+                if (!empty($this->_gameResults['description'])) {
395 395
                     $game['review'] = (string) $this->_gameResults['description'];
396 396
                 }
397 397
 
398
-                if (! empty($this->_gameResults['genres'])) {
398
+                if (!empty($this->_gameResults['genres'])) {
399 399
                     $genres = $this->_gameResults['genres'];
400 400
                     $genreName = $this->_matchGenre($genres);
401 401
                 }
402 402
             }
403 403
         }
404 404
 
405
-        if (! empty($this->publicKey)) {
405
+        if (!empty($this->publicKey)) {
406 406
             if ($steamGameID === false || $this->_gameResults === false) {
407 407
                 $bestMatch = false;
408 408
                 $this->_classUsed = 'GiantBomb';
409 409
                 try {
410 410
                     $result = $this->giantBomb->search($gameInfo['title'], 'Game');
411
-                    if (! \is_object($result)) {
411
+                    if (!\is_object($result)) {
412 412
                         $bestMatchPct = 0;
413 413
                         foreach ($result as $res) {
414 414
                             similar_text(strtolower($gameInfo['title']), strtolower($res->name), $percent1);
@@ -421,17 +421,17 @@  discard block
 block discarded – undo
421 421
                         if ($bestMatch !== false) {
422 422
                             $this->_gameResults = $this->giantBomb->findWithResourceID('Game', '3030-'.$bestMatch);
423 423
 
424
-                            if (! empty($this->_gameResults->image['medium_url'])) {
424
+                            if (!empty($this->_gameResults->image['medium_url'])) {
425 425
                                 $game['coverurl'] = (string) $this->_gameResults->image['medium_url'];
426 426
                             }
427 427
 
428
-                            if (! empty($this->_gameResults->image['screen_url'])) {
428
+                            if (!empty($this->_gameResults->image['screen_url'])) {
429 429
                                 $game['backdropurl'] = (string) $this->_gameResults->image['screen_url'];
430 430
                             }
431 431
 
432 432
                             $game['title'] = (string) $this->_gameResults->get('name');
433 433
                             $game['asin'] = $this->_gameResults->get('id');
434
-                            if (! empty($this->_gameResults->get('site_detail_url'))) {
434
+                            if (!empty($this->_gameResults->get('site_detail_url'))) {
435 435
                                 $game['url'] = (string) $this->_gameResults->get('site_detail_url');
436 436
                             } else {
437 437
                                 $game['url'] = '';
@@ -443,7 +443,7 @@  discard block
 block discarded – undo
443 443
                                 $game['publisher'] = 'Unknown';
444 444
                             }
445 445
 
446
-                            if (! empty($this->_gameResults->original_game_rating[0]['name'])) {
446
+                            if (!empty($this->_gameResults->original_game_rating[0]['name'])) {
447 447
                                 $game['esrb'] = $this->_gameResults->original_game_rating[0]['name'] ?? 'Not Rated';
448 448
                             } else {
449 449
                                 $game['esrb'] = 'Not Rated';
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
                     $bestMatch = false;
481 481
                     $this->_classUsed = 'IGDB';
482 482
                     $result = Game::where('name', $gameInfo['title'])->get();
483
-                    if (! empty($result)) {
483
+                    if (!empty($result)) {
484 484
                         $bestMatchPct = 0;
485 485
                         foreach ($result as $res) {
486 486
                             similar_text(strtolower($gameInfo['title']), strtolower($res->name), $percent1);
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
                             ])->where('id', $bestMatch)->first();
499 499
 
500 500
                             $publishers = [];
501
-                            if (! empty($this->_gameResults->involved_companies)) {
501
+                            if (!empty($this->_gameResults->involved_companies)) {
502 502
                                 foreach ($this->_gameResults->involved_companies as $publisher) {
503 503
                                     if ($publisher['publisher'] === true) {
504 504
                                         $company = Company::find($publisher['company']);
@@ -509,7 +509,7 @@  discard block
 block discarded – undo
509 509
 
510 510
                             $genres = [];
511 511
 
512
-                            if (! empty($this->_gameResults->themes)) {
512
+                            if (!empty($this->_gameResults->themes)) {
513 513
                                 foreach ($this->_gameResults->themes as $theme) {
514 514
                                     $genres[] = $theme['name'];
515 515
                                 }
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
                                 'esrb' => isset($this->_gameResults->aggregated_rating) ? round($this->_gameResults->aggregated_rating).'%' : 'Not Rated',
532 532
                                 'url' => $this->_gameResults->url ?? '',
533 533
                                 'backdropurl' => isset($this->_gameResults->screenshots) ? 'https:'.str_replace('t_thumb', 't_cover_big', $this->_gameResults->screenshots[0]['url']) : '',
534
-                                'publisher' => ! empty($publishers) ? implode(',', $publishers) : 'Unknown',
534
+                                'publisher' => !empty($publishers) ? implode(',', $publishers) : 'Unknown',
535 535
                             ];
536 536
                         } else {
537 537
                             $this->colorCli->notice('IGDB returned no valid results');
@@ -565,20 +565,20 @@  discard block
 block discarded – undo
565 565
         } else {
566 566
             $game['backdrop'] = 0;
567 567
         }
568
-        if (! isset($game['trailer'])) {
568
+        if (!isset($game['trailer'])) {
569 569
             $game['trailer'] = 0;
570 570
         }
571 571
         if (empty($game['title'])) {
572 572
             $game['title'] = $gameInfo['title'];
573 573
         }
574
-        if (! isset($game['releasedate'])) {
574
+        if (!isset($game['releasedate'])) {
575 575
             $game['releasedate'] = '';
576 576
         }
577 577
 
578 578
         if ($game['releasedate'] === '') {
579 579
             $game['releasedate'] = '';
580 580
         }
581
-        if (! isset($game['review'])) {
581
+        if (!isset($game['review'])) {
582 582
             $game['review'] = 'No Review';
583 583
         }
584 584
         $game['classused'] = $this->_classUsed;
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
         $game['gamesgenre'] = $genreName;
597 597
         $game['gamesgenreID'] = $genreKey;
598 598
 
599
-        if (! empty($game['asin'])) {
599
+        if (!empty($game['asin'])) {
600 600
             $check = GamesInfo::query()->where('asin', $game['asin'])->first();
601 601
             if ($check === null) {
602 602
                 $gamesId = GamesInfo::query()
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
             }
642 642
         }
643 643
 
644
-        if (! empty($gamesId)) {
644
+        if (!empty($gamesId)) {
645 645
             if ($this->echoOutput) {
646 646
                 $this->colorCli->header('Added/updated game: ').
647 647
                     $this->colorCli->alternateOver('   Title:    ').
@@ -660,7 +660,7 @@  discard block
 block discarded – undo
660 660
                 $this->colorCli->primary($game['title'].' (PC)');
661 661
         }
662 662
 
663
-        return ! empty($gamesId) ? $gamesId : false;
663
+        return !empty($gamesId) ? $gamesId : false;
664 664
     }
665 665
 
666 666
     /**
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
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         $this->colorCli = new ColorCLI();
78 78
 
79 79
         $this->tmpPath = (string) Settings::settingValue('..tmpunrarpath');
80
-        if (! preg_match('/[\/\\\\]$/', $this->tmpPath)) {
80
+        if (!preg_match('/[\/\\\\]$/', $this->tmpPath)) {
81 81
             $this->tmpPath .= '/';
82 82
         }
83 83
     }
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         $size = \strlen($possibleNFO);
139 139
         if ($size < 65535 &&
140 140
             $size > 11 &&
141
-            ! preg_match(
141
+            !preg_match(
142 142
                 '/\A(\s*<\?xml|=newz\[NZB\]=|RIFF|\s*[RP]AR|.{0,10}(JFIF|matroska|ftyp|ID3))|;\s*Generated\s*by.*SF\w/i',
143 143
                 $possibleNFO
144 144
             )) {
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
 
149 149
             // Linux boxes have 'file' (so should Macs), Windows *can* have it too: see GNUWIN.txt in docs.
150 150
             $result = Utility::fileInfo($tmpPath);
151
-            if (! empty($result)) {
151
+            if (!empty($result)) {
152 152
                 // Check if it's text.
153 153
                 if (preg_match('/(ASCII|ISO-8859|UTF-(8|16|32).*?)\s*text/', $result)) {
154 154
                     @File::delete($tmpPath);
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 
207 207
             Release::whereId($release->id)->update(['nfostatus' => self::NFO_FOUND]);
208 208
 
209
-            if (! isset($release->completion)) {
209
+            if (!isset($release->completion)) {
210 210
                 $release->completion = 0;
211 211
             }
212 212
 
Please login to merge, or discard this patch.
Blacklight/Music.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
 			%s %s %s
196 196
 			GROUP BY m.id
197 197
 			ORDER BY %s %s',
198
-            ! empty($musicIDs) ? 'WHERE m.id IN ('.implode(',', $musicIDs).')' : 'AND 1=1',
199
-            (! empty($releaseIDs)) ? 'AND r.id in ('.implode(',', $releaseIDs).')' : '',
198
+            !empty($musicIDs) ? 'WHERE m.id IN ('.implode(',', $musicIDs).')' : 'AND 1=1',
199
+            (!empty($releaseIDs)) ? 'AND r.id in ('.implode(',', $releaseIDs).')' : '',
200 200
             $catsrch,
201 201
             $order[0],
202 202
             $order[1]
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
     {
262 262
         $browseby = ' ';
263 263
         foreach ($this->getBrowseByOptions() as $bbk => $bbv) {
264
-            if (! empty($_REQUEST[$bbk])) {
264
+            if (!empty($_REQUEST[$bbk])) {
265 265
                 $bbs = stripslashes($_REQUEST[$bbk]);
266 266
                 if (stripos($bbv, 'id') !== false) {
267 267
                     $browseby .= ' AND m.'.$bbv.' = '.$bbs;
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
             )
414 414
         );
415 415
 
416
-        if (! empty($res)) {
416
+        if (!empty($res)) {
417 417
             foreach ($res as $arr) {
418 418
                 $startTime = now();
419 419
                 $usedAmazon = false;
@@ -486,7 +486,7 @@  discard block
 block discarded – undo
486 486
             $h = trim(preg_replace('/\s\s+/', ' ', $g));
487 487
             $newname = trim(preg_replace('/ [a-z]{2}$| [a-z]{3} \d{2,}$|\d{5,} \d{5,}$|-WEB$/i', '', $h));
488 488
 
489
-            if (! preg_match('/^[a-z0-9]+$/i', $newname) && strlen($newname) > 10) {
489
+            if (!preg_match('/^[a-z0-9]+$/i', $newname) && strlen($newname) > 10) {
490 490
                 $result['name'] = $newname;
491 491
 
492 492
                 return $result;
Please login to merge, or discard this patch.
Blacklight/ReleaseRemover.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
                 $this->colorCLI->header('Removing '.($type === '' ? 'All crap releases ' : $type.' crap releases').' - no time limit.', true);
169 169
             }
170 170
         } else {
171
-            if (! is_numeric($time)) {
171
+            if (!is_numeric($time)) {
172 172
                 $this->error = 'Error, time must be a number or full.';
173 173
 
174 174
                 return $this->returnError();
@@ -656,7 +656,7 @@  discard block
 block discarded – undo
656 656
     {
657 657
         $status = sprintf('AND status = %d', Binaries::BLACKLIST_ENABLED);
658 658
 
659
-        if (! empty($this->blacklistID) && $this->delete === false) {
659
+        if (!empty($this->blacklistID) && $this->delete === false) {
660 660
             $status = '';
661 661
         }
662 662
 
@@ -1130,7 +1130,7 @@  discard block
 block discarded – undo
1130 1130
                     }
1131 1131
                     break;
1132 1132
                 case 'size':
1133
-                    if (! is_numeric($args[2])) {
1133
+                    if (!is_numeric($args[2])) {
1134 1134
                         break;
1135 1135
                     }
1136 1136
                     switch ($args[1]) {
@@ -1145,7 +1145,7 @@  discard block
 block discarded – undo
1145 1145
                     }
1146 1146
                     break;
1147 1147
                 case 'adddate':
1148
-                    if (! is_numeric($args[2])) {
1148
+                    if (!is_numeric($args[2])) {
1149 1149
                         break;
1150 1150
                     }
1151 1151
                     switch ($args[1]) {
@@ -1158,7 +1158,7 @@  discard block
 block discarded – undo
1158 1158
                     }
1159 1159
                     break;
1160 1160
                 case 'postdate':
1161
-                    if (! is_numeric($args[2])) {
1161
+                    if (!is_numeric($args[2])) {
1162 1162
                         break;
1163 1163
                     }
1164 1164
                     switch ($args[1]) {
@@ -1171,7 +1171,7 @@  discard block
 block discarded – undo
1171 1171
                     }
1172 1172
                     break;
1173 1173
                 case 'completion':
1174
-                    if (! is_numeric($args[2])) {
1174
+                    if (!is_numeric($args[2])) {
1175 1175
                         break;
1176 1176
                     }
1177 1177
                     if ($args[1] === 'smaller') {
Please login to merge, or discard this patch.
Blacklight/Releases.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 				GROUP BY r.id
278 278
 				ORDER BY %s %s %s",
279 279
             $this->uSQL($userShows, 'videos_id'),
280
-            (! empty($excludedCats) ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''),
280
+            (!empty($excludedCats) ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''),
281 281
             NZB::NZB_ADDED,
282 282
             Category::TV_ROOT,
283 283
             Category::TV_OTHER,
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
     {
348 348
         // Delete NZB from disk.
349 349
         $nzbPath = $nzb->NZBPath($identifiers['g']);
350
-        if (! empty($nzbPath)) {
350
+        if (!empty($nzbPath)) {
351 351
             File::delete($nzbPath);
352 352
         }
353 353
 
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
      */
388 388
     public function updateMulti($guids, $category, $grabs, $videoId, $episodeId, $anidbId, $imdbId)
389 389
     {
390
-        if (! \is_array($guids) || \count($guids) < 1) {
390
+        if (!\is_array($guids) || \count($guids) < 1) {
391 391
             return false;
392 392
         }
393 393
 
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
         $sql = '(1=2 ';
412 412
         foreach ($userQuery as $query) {
413 413
             $sql .= sprintf('OR (r.%s = %d', $type, $query->$type);
414
-            if (! empty($query->categories)) {
414
+            if (!empty($query->categories)) {
415 415
                 $catsArr = explode('|', $query->categories);
416 416
                 if (\count($catsArr) > 1) {
417 417
                     $sql .= sprintf(' AND r.categories_id IN (%s)', implode(',', $catsArr));
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
             $orderBy = $this->getBrowseOrder($orderBy);
456 456
         }
457 457
 
458
-        $searchFields = Arr::where($searchArr, static function ($value) {
458
+        $searchFields = Arr::where($searchArr, static function($value) {
459 459
             return $value !== -1;
460 460
         });
461 461
 
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
             $searchResult = $this->elasticSearch->indexSearch($phrases, $limit);
466 466
         } else {
467 467
             $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', '', [], $searchFields);
468
-            if (! empty($searchResult)) {
468
+            if (!empty($searchResult)) {
469 469
                 $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
470 470
             }
471 471
         }
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
                 $searchResult = $this->elasticSearch->indexSearchApi($searchName, $limit);
557 557
             } else {
558 558
                 $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $searchName, ['searchname']);
559
-                if (! empty($searchResult)) {
559
+                if (!empty($searchResult)) {
560 560
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
561 561
                 }
562 562
             }
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
             ((int) $groupName !== -1 ? sprintf(' AND r.groups_id = %d ', UsenetGroup::getIDByName($groupName)) : ''),
573 573
             $catQuery,
574 574
             (\count($excludedCats) > 0 ? ' AND r.categories_id NOT IN ('.implode(',', $excludedCats).')' : ''),
575
-            (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
575
+            (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
576 576
             ($minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : '')
577 577
         );
578 578
         $baseSql = sprintf(
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
         if ($releases !== null) {
607 607
             return $releases;
608 608
         }
609
-        if ($searchName !== -1 && ! empty($searchResult)) {
609
+        if ($searchName !== -1 && !empty($searchResult)) {
610 610
             $releases = self::fromQuery($sql);
611 611
         } elseif ($searchName !== -1 && empty($searchResult)) {
612 612
             $releases = collect();
@@ -656,13 +656,13 @@  discard block
 block discarded – undo
656 656
                 ($airDate !== '' ? sprintf('AND DATE(tve.firstaired) = %s', escapeString($airDate)) : '')
657 657
             );
658 658
             $show = self::fromQuery($showQry);
659
-            if (! empty($show[0]) && $show->isNotEmpty()) {
660
-                if ((! empty($series) || ! empty($episode) || ! empty($airDate)) && $show[0]->episodes !== '') {
659
+            if (!empty($show[0]) && $show->isNotEmpty()) {
660
+                if ((!empty($series) || !empty($episode) || !empty($airDate)) && $show[0]->episodes !== '') {
661 661
                     $showSql = sprintf('AND r.tv_episodes_id IN (%s)', $show[0]->episodes);
662 662
                 } elseif ((int) $show[0]->video > 0) {
663 663
                     $showSql = 'AND r.videos_id = '.$show[0]->video;
664 664
                     // If $series is set but episode is not, return Season Packs only
665
-                    if (! empty($series) && empty($episode)) {
665
+                    if (!empty($series) && empty($episode)) {
666 666
                         $showSql .= ' AND r.tv_episodes_id = 0';
667 667
                     }
668 668
                 } else {
@@ -675,22 +675,22 @@  discard block
 block discarded – undo
675 675
             }
676 676
         }
677 677
         // If $name is set it is a fallback search, add available SxxExx/airdate info to the query
678
-        if (! empty($name) && $showSql === '') {
679
-            if (! empty($series) && (int) $series < 1900) {
678
+        if (!empty($name) && $showSql === '') {
679
+            if (!empty($series) && (int) $series < 1900) {
680 680
                 $name .= sprintf(' S%s', str_pad($series, 2, '0', STR_PAD_LEFT));
681
-                if (! empty($episode) && ! str_contains($episode, '/')) {
681
+                if (!empty($episode) && !str_contains($episode, '/')) {
682 682
                     $name .= sprintf('E%s', str_pad($episode, 2, '0', STR_PAD_LEFT));
683 683
                 }
684
-            } elseif (! empty($airDate)) {
684
+            } elseif (!empty($airDate)) {
685 685
                 $name .= sprintf(' %s', str_replace(['/', '-', '.', '_'], ' ', $airDate));
686 686
             }
687 687
         }
688
-        if (! empty($name)) {
688
+        if (!empty($name)) {
689 689
             if (config('nntmux.elasticsearch_enabled') === true) {
690 690
                 $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit);
691 691
             } else {
692 692
                 $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']);
693
-                if (! empty($searchResult)) {
693
+                if (!empty($searchResult)) {
694 694
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
695 695
                 }
696 696
             }
@@ -706,11 +706,11 @@  discard block
 block discarded – undo
706 706
             NZB::NZB_ADDED,
707 707
             $this->showPasswords(),
708 708
             $showSql,
709
-            (! empty($name) && ! empty($searchResult)) ? 'AND r.id IN ('.implode(',', $searchResult).')' : '',
709
+            (!empty($name) && !empty($searchResult)) ? 'AND r.id IN ('.implode(',', $searchResult).')' : '',
710 710
             (empty($searchResult)) ? Category::getCategorySearch($cat) : '',
711 711
             $maxAge > 0 ? sprintf('AND r.postdate > NOW() - INTERVAL %d DAY', $maxAge) : '',
712 712
             $minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : '',
713
-            ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : ''
713
+            !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : ''
714 714
         );
715 715
         $baseSql = sprintf(
716 716
             "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,
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
         if ($releases !== null) {
747 747
             return $releases;
748 748
         }
749
-        $releases = ((! empty($name) && ! empty($searchResult)) || empty($name)) ? self::fromQuery($sql) : [];
749
+        $releases = ((!empty($name) && !empty($searchResult)) || empty($name)) ? self::fromQuery($sql) : [];
750 750
         if (count($releases) !== 0 && $releases->isNotEmpty()) {
751 751
             $releases[0]->_totalrows = $this->getPagerCount(
752 752
                 preg_replace('#LEFT(\s+OUTER)?\s+JOIN\s+(?!tv_episodes)\s+.*ON.*=.*\n#i', ' ', $baseSql)
@@ -792,12 +792,12 @@  discard block
 block discarded – undo
792 792
             );
793 793
             $show = self::fromQuery($showQry);
794 794
             if ($show->isNotEmpty()) {
795
-                if ((! empty($series) || ! empty($episode) || ! empty($airDate)) && $show[0]->episodes !== '') {
795
+                if ((!empty($series) || !empty($episode) || !empty($airDate)) && $show[0]->episodes !== '') {
796 796
                     $showSql = sprintf('AND r.tv_episodes_id IN (%s)', $show[0]->episodes);
797 797
                 } elseif ((int) $show[0]->video > 0) {
798 798
                     $showSql = 'AND r.videos_id = '.$show[0]->video;
799 799
                     // If $series is set but episode is not, return Season Packs only
800
-                    if (! empty($series) && empty($episode)) {
800
+                    if (!empty($series) && empty($episode)) {
801 801
                         $showSql .= ' AND r.tv_episodes_id = 0';
802 802
                     }
803 803
                 } else {
@@ -810,22 +810,22 @@  discard block
 block discarded – undo
810 810
             }
811 811
         }
812 812
         // If $name is set it is a fallback search, add available SxxExx/airdate info to the query
813
-        if (! empty($name) && $showSql === '') {
814
-            if (! empty($series) && (int) $series < 1900) {
813
+        if (!empty($name) && $showSql === '') {
814
+            if (!empty($series) && (int) $series < 1900) {
815 815
                 $name .= sprintf(' S%s', str_pad($series, 2, '0', STR_PAD_LEFT));
816
-                if (! empty($episode) && ! str_contains($episode, '/')) {
816
+                if (!empty($episode) && !str_contains($episode, '/')) {
817 817
                     $name .= sprintf('E%s', str_pad($episode, 2, '0', STR_PAD_LEFT));
818 818
                 }
819
-            } elseif (! empty($airDate)) {
819
+            } elseif (!empty($airDate)) {
820 820
                 $name .= sprintf(' %s', str_replace(['/', '-', '.', '_'], ' ', $airDate));
821 821
             }
822 822
         }
823
-        if (! empty($name)) {
823
+        if (!empty($name)) {
824 824
             if (config('nntmux.elasticsearch_enabled') === true) {
825 825
                 $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit);
826 826
             } else {
827 827
                 $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']);
828
-                if (! empty($searchResult)) {
828
+                if (!empty($searchResult)) {
829 829
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
830 830
                 }
831 831
             }
@@ -841,11 +841,11 @@  discard block
 block discarded – undo
841 841
             NZB::NZB_ADDED,
842 842
             $this->showPasswords(),
843 843
             $showSql,
844
-            (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
844
+            (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
845 845
             Category::getCategorySearch($cat),
846 846
             ($maxAge > 0 ? sprintf('AND r.postdate > NOW() - INTERVAL %d DAY', $maxAge) : ''),
847 847
             ($minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : ''),
848
-            ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : ''
848
+            !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : ''
849 849
         );
850 850
         $baseSql = sprintf(
851 851
             "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,
@@ -895,12 +895,12 @@  discard block
 block discarded – undo
895 895
      */
896 896
     public function animeSearch($aniDbID, int $offset = 0, int $limit = 100, string $name = '', array $cat = [-1], int $maxAge = -1, array $excludedCategories = []): mixed
897 897
     {
898
-        if (! empty($name)) {
898
+        if (!empty($name)) {
899 899
             if (config('nntmux.elasticsearch_enabled') === true) {
900 900
                 $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit);
901 901
             } else {
902 902
                 $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']);
903
-                if (! empty($searchResult)) {
903
+                if (!empty($searchResult)) {
904 904
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
905 905
                 }
906 906
             }
@@ -917,8 +917,8 @@  discard block
 block discarded – undo
917 917
             $this->showPasswords(),
918 918
             NZB::NZB_ADDED,
919 919
             ($aniDbID > -1 ? sprintf(' AND r.anidbid = %d ', $aniDbID) : ''),
920
-            (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
921
-            ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '',
920
+            (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
921
+            !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '',
922 922
             Category::getCategorySearch($cat),
923 923
             ($maxAge > 0 ? sprintf(' AND r.postdate > NOW() - INTERVAL %d DAY ', $maxAge) : '')
924 924
         );
@@ -967,12 +967,12 @@  discard block
 block discarded – undo
967 967
      */
968 968
     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
969 969
     {
970
-        if (! empty($name)) {
970
+        if (!empty($name)) {
971 971
             if (config('nntmux.elasticsearch_enabled') === true) {
972 972
                 $searchResult = $this->elasticSearch->indexSearchTMA($name, $limit);
973 973
             } else {
974 974
                 $searchResult = $this->manticoreSearch->searchIndexes('releases_rt', $name, ['searchname']);
975
-                if (! empty($searchResult)) {
975
+                if (!empty($searchResult)) {
976 976
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
977 977
                 }
978 978
             }
@@ -989,11 +989,11 @@  discard block
 block discarded – undo
989 989
 			%s %s %s %s %s %s %s',
990 990
             NZB::NZB_ADDED,
991 991
             $this->showPasswords(),
992
-            (! empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
992
+            (!empty($searchResult) ? 'AND r.id IN ('.implode(',', $searchResult).')' : ''),
993 993
             ($imDbId !== -1 && is_numeric($imDbId)) ? sprintf(' AND m.imdbid = %d ', $imDbId) : '',
994 994
             ($tmDbId !== -1 && is_numeric($tmDbId)) ? sprintf(' AND m.tmdbid = %d ', $tmDbId) : '',
995 995
             ($traktId !== -1 && is_numeric($traktId)) ? sprintf(' AND m.traktid = %d ', $traktId) : '',
996
-            ! empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '',
996
+            !empty($excludedCategories) ? sprintf('AND r.categories_id NOT IN('.implode(',', $excludedCategories).')') : '',
997 997
             Category::getCategorySearch($cat),
998 998
             $maxAge > 0 ? sprintf(' AND r.postdate > NOW() - INTERVAL %d DAY ', $maxAge) : '',
999 999
             $minSize > 0 ? sprintf('AND r.size >= %d', $minSize) : ''
@@ -1045,7 +1045,7 @@  discard block
 block discarded – undo
1045 1045
             $parentCat = $catRow['root_categories_id'];
1046 1046
 
1047 1047
             $results = $this->search(['searchname' => getSimilarName($name)], -1, '', '', -1, -1, 0, config('nntmux.items_per_page'), '', -1, $excludedCats, 'basic', [$parentCat]);
1048
-            if (! $results) {
1048
+            if (!$results) {
1049 1049
                 return $ret;
1050 1050
             }
1051 1051
 
Please login to merge, or discard this patch.
Blacklight/NZBExport.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -49,19 +49,19 @@  discard block
 block discarded – undo
49 49
         $path = $params[0];
50 50
 
51 51
         // Check if the path ends with dir separator.
52
-        if (! Str::endsWith($path, '/')) {
52
+        if (!Str::endsWith($path, '/')) {
53 53
             $path .= '/';
54 54
         }
55 55
 
56 56
         // Check if it's a directory.
57
-        if (! File::isDirectory($path)) {
57
+        if (!File::isDirectory($path)) {
58 58
             $this->echoOut('Folder does not exist: '.$path);
59 59
 
60 60
             return $this->returnValue();
61 61
         }
62 62
 
63 63
         // Check if we can write to it.
64
-        if (! is_writable($path)) {
64
+        if (!is_writable($path)) {
65 65
             $this->echoOut('Folder is not writable: '.$path);
66 66
 
67 67
             return $this->returnValue();
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 
70 70
         // Check if the from date is the proper format.
71 71
         if (isset($params[1]) && $params[1] !== '') {
72
-            if (! $this->checkDate($params[1])) {
72
+            if (!$this->checkDate($params[1])) {
73 73
                 return $this->returnValue();
74 74
             }
75 75
             $fromDate = $params[1];
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 
78 78
         // Check if the to date is the proper format.
79 79
         if (isset($params[2]) && $params[2] !== '') {
80
-            if (! $this->checkDate($params[2])) {
80
+            if (!$this->checkDate($params[2])) {
81 81
                 return $this->returnValue();
82 82
             }
83 83
             $toDate = $params[2];
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
         // Check if the group_id exists.
87 87
         if (isset($params[3]) && $params[3] !== 0) {
88
-            if (! is_numeric($params[3])) {
88
+            if (!is_numeric($params[3])) {
89 89
                 $this->echoOut('The group ID is not a number: '.$params[3]);
90 90
 
91 91
                 return $this->returnValue();
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
             // Create a path to store the new NZB files.
122 122
             $currentPath = $path.$this->safeFilename($group['name']).'/';
123
-            if (! File::isDirectory($currentPath) && ! File::makeDirectory($currentPath) && ! File::isDirectory($currentPath)) {
123
+            if (!File::isDirectory($currentPath) && !File::makeDirectory($currentPath) && !File::isDirectory($currentPath)) {
124 124
                 throw new \RuntimeException(sprintf('Directory "%s" was not created', $currentPath));
125 125
             }
126 126
             foreach ($releases as $release) {
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 
141 141
                 // Check if the user wants them in gzip, copy it if so.
142 142
                 if ($gzip) {
143
-                    if (! copy($nzbFile, $currentFile.'.nzb.gz')) {
143
+                    if (!copy($nzbFile, $currentFile.'.nzb.gz')) {
144 144
                         if ($this->echoCLI) {
145 145
                             echo 'Unable to export NZB with GUID: '.$release['guid'];
146 146
                         }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
                     // If not, decompress it and create a file to store it in.
151 151
                 } else {
152 152
                     $nzbContents = Utility::unzipGzipFile($nzbFile);
153
-                    if (! $nzbContents) {
153
+                    if (!$nzbContents) {
154 154
                         if ($this->echoCLI) {
155 155
                             echo 'Unable to export NZB with GUID: '.$release['guid'];
156 156
                         }
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 
191 191
     protected function checkDate($date): bool
192 192
     {
193
-        if (! preg_match('/^(\d{2}\/){2}\d{4}$/', $date)) {
193
+        if (!preg_match('/^(\d{2}\/){2}\d{4}$/', $date)) {
194 194
             $this->echoOut('Wrong date format: '.$date);
195 195
 
196 196
             return false;
Please login to merge, or discard this patch.
Blacklight/TmuxRun.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -687,7 +687,7 @@
 block discarded – undo
687 687
     {
688 688
         $sharing = (array) Arr::first(DB::select('SELECT enabled, posting, fetching FROM sharing'));
689 689
 
690
-        if (! empty($sharing) && (int) $sharing['enabled'] === 1 && (int) $runVar['settings']['run_sharing'] === 1 && ((int) $sharing['posting'] === 1 || (int) $sharing['fetching'] === 1) && shell_exec("tmux list-panes -t{$runVar['constants']['tmux_session']}:{$pane} | grep ^0 | grep -c dead") == 1) {
690
+        if (!empty($sharing) && (int) $sharing['enabled'] === 1 && (int) $runVar['settings']['run_sharing'] === 1 && ((int) $sharing['posting'] === 1 || (int) $sharing['fetching'] === 1) && shell_exec("tmux list-panes -t{$runVar['constants']['tmux_session']}:{$pane} | grep ^0 | grep -c dead") == 1) {
691 691
             shell_exec(
692 692
                 "tmux respawnp -t{$runVar['constants']['tmux_session']}:{$pane}.0 ' \
693 693
                     {$runVar['commands']['_php']} {$runVar['paths']['misc']}/update/multiprocessing/postprocess.php sha; \
Please login to merge, or discard this patch.
Blacklight/CollectionsCleaning.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
107 107
     protected function generic(): array
108 108
     {
109 109
         // For non music groups.
110
-        if (! preg_match('/\.(flac|lossless|mp3|music|sounds)/', $this->groupName)) {
110
+        if (!preg_match('/\.(flac|lossless|mp3|music|sounds)/', $this->groupName)) {
111 111
             // File/part count.
112 112
             // File extensions.
113 113
             // File extensions - If it was not in quotes.
Please login to merge, or discard this patch.