Passed
Push — master ( ffffc8...7f28ae )
by Darko
12:16 queued 06:00
created
Blacklight/NZB.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         $nzbSplitLevel = (int) Settings::settingValue('..nzbsplitlevel');
67 67
         $this->nzbSplitLevel = $nzbSplitLevel ?? 1;
68 68
         $this->siteNzbPath = (string) Settings::settingValue('..nzbpath');
69
-        if (! Str::endsWith($this->siteNzbPath, '/')) {
69
+        if (!Str::endsWith($this->siteNzbPath, '/')) {
70 70
             $this->siteNzbPath .= '/';
71 71
         }
72 72
         $this->_nzbCommentString = sprintf(
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
         $XMLWriter->startElement('head');
111 111
         $XMLWriter->startElement('meta');
112 112
         $XMLWriter->writeAttribute('type', 'category');
113
-        $XMLWriter->text(! empty($release->category->parent) ? $release->category->parent->title.' >'.$release->category->title : 'Other > Misc');
113
+        $XMLWriter->text(!empty($release->category->parent) ? $release->category->parent->title.' >'.$release->category->title : 'Other > Misc');
114 114
         $XMLWriter->endElement();
115 115
         $XMLWriter->startElement('meta');
116 116
         $XMLWriter->writeAttribute('type', 'name');
@@ -172,20 +172,20 @@  discard block
 block discarded – undo
172 172
         $XMLWriter->endDocument();
173 173
         $path = ($this->buildNZBPath($release->guid, $this->nzbSplitLevel, true).$release->guid.'.nzb.gz');
174 174
         $fp = gzopen($path, 'wb7');
175
-        if (! $fp) {
175
+        if (!$fp) {
176 176
             return false;
177 177
         }
178 178
         gzwrite($fp, $XMLWriter->outputMemory());
179 179
         gzclose($fp);
180 180
         unset($XMLWriter);
181
-        if (! File::isFile($path)) {
181
+        if (!File::isFile($path)) {
182 182
             echo "ERROR: $path does not exist.\n";
183 183
 
184 184
             return false;
185 185
         }
186 186
         // Mark release as having NZB.
187 187
         $release->update(['nzbstatus' => self::NZB_ADDED]);
188
-        if (! empty($nzb_guid)) {
188
+        if (!empty($nzb_guid)) {
189 189
             $release->update(['nzb_guid' => DB::raw('UNHEX( '.escapeString(md5($nzb_guid)).' )')]);
190 190
         }
191 191
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 
217 217
         $nzbPath = $this->siteNzbPath.$nzbPath;
218 218
 
219
-        if ($createIfNotExist && ! File::isDirectory($nzbPath) && ! File::makeDirectory($nzbPath, 0777, true) && ! File::isDirectory($nzbPath)) {
219
+        if ($createIfNotExist && !File::isDirectory($nzbPath) && !File::makeDirectory($nzbPath, 0777, true) && !File::isDirectory($nzbPath)) {
220 220
             throw new \RuntimeException(sprintf('Directory "%s" was not created', $nzbPath));
221 221
         }
222 222
 
@@ -275,12 +275,12 @@  discard block
 block discarded – undo
275 275
         $i = 0;
276 276
         $result = [];
277 277
 
278
-        if (! $nzb) {
278
+        if (!$nzb) {
279 279
             return $result;
280 280
         }
281 281
 
282 282
         $xml = @simplexml_load_string(str_replace("\x0F", '', $nzb));
283
-        if (! $xml || strtolower($xml->getName()) !== 'nzb') {
283
+        if (!$xml || strtolower($xml->getName()) !== 'nzb') {
284 284
             return $result;
285 285
         }
286 286
 
@@ -294,9 +294,9 @@  discard block
 block discarded – undo
294 294
                     // Strip file / part count to get proper sorting.
295 295
                     $i = preg_replace('#\d+[- ._]?(/|\||[o0]f)[- ._]?\d+?(?![- ._]\d)#i', '', $i);
296 296
                     // Change .rar and .par2 to be sorted before .part0x.rar and .volxxx+xxx.par2
297
-                    if (str_contains($i, '.par2') && ! preg_match('#\.vol\d+\+\d+\.par2#i', $i)) {
297
+                    if (str_contains($i, '.par2') && !preg_match('#\.vol\d+\+\d+\.par2#i', $i)) {
298 298
                         $i = str_replace('.par2', '.vol0.par2', $i);
299
-                    } elseif (preg_match('#\.rar[^a-z0-9]#i', $i) && ! preg_match('#\.part\d+\.rar$#i', $i)) {
299
+                    } elseif (preg_match('#\.rar[^a-z0-9]#i', $i) && !preg_match('#\.part\d+\.rar$#i', $i)) {
300 300
                         $i = preg_replace('#\.rar(?:[^a-z0-9])#i', '.part0.rar', $i);
301 301
                     }
302 302
                 }
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
             $fileSize = $numSegments = 0;
330 330
 
331 331
             // Parts.
332
-            if (! isset($result[$i]['segments'])) {
332
+            if (!isset($result[$i]['segments'])) {
333 333
                 $result[$i]['segments'] = [];
334 334
             }
335 335
 
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
             $result[$i]['partsactual'] = $numSegments;
349 349
 
350 350
             // Groups.
351
-            if (! isset($result[$i]['groups'])) {
351
+            if (!isset($result[$i]['groups'])) {
352 352
                 $result[$i]['groups'] = [];
353 353
             }
354 354
             foreach ($file->groups->group as $g) {
Please login to merge, or discard this patch.
Blacklight/IRCScraper.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         $channels = config('irc_settings.scrape_irc_channels') ? unserialize(config('irc_settings.scrape_irc_channels'), ['allowed_classes' => ['#PreNNTmux', '#nZEDbPRE']]) : ['#PreNNTmux' => null];
174 174
         $this->joinChannels($channels);
175 175
 
176
-        if (! $this->_silent) {
176
+        if (!$this->_silent) {
177 177
             echo '['.
178 178
                 date('r').
179 179
                 '] [Scraping of IRC channels for ('.
@@ -291,34 +291,34 @@  discard block
 block discarded – undo
291 291
         } else {
292 292
             $indexData = $this->manticoreSearch->searchIndexes('predb_rt', $this->_curPre['title'], ['title']);
293 293
         }
294
-        if (! empty($indexData) || empty($this->_curPre['title'])) {
294
+        if (!empty($indexData) || empty($this->_curPre['title'])) {
295 295
             return;
296 296
         }
297 297
 
298 298
         $query = 'INSERT INTO predb (';
299 299
 
300
-        $query .= (! empty($this->_curPre['size']) ? 'size, ' : '');
301
-        $query .= (! empty($this->_curPre['category']) ? 'category, ' : '');
302
-        $query .= (! empty($this->_curPre['source']) ? 'source, ' : '');
303
-        $query .= (! empty($this->_curPre['reason']) ? 'nukereason, ' : '');
304
-        $query .= (! empty($this->_curPre['files']) ? 'files, ' : '');
305
-        $query .= (! empty($this->_curPre['reqid']) ? 'requestid, ' : '');
306
-        $query .= (! empty($this->_curPre['group_id']) ? 'groups_id, ' : '');
307
-        $query .= (! empty($this->_curPre['nuked']) ? 'nuked, ' : '');
308
-        $query .= (! empty($this->_curPre['filename']) ? 'filename, ' : '');
300
+        $query .= (!empty($this->_curPre['size']) ? 'size, ' : '');
301
+        $query .= (!empty($this->_curPre['category']) ? 'category, ' : '');
302
+        $query .= (!empty($this->_curPre['source']) ? 'source, ' : '');
303
+        $query .= (!empty($this->_curPre['reason']) ? 'nukereason, ' : '');
304
+        $query .= (!empty($this->_curPre['files']) ? 'files, ' : '');
305
+        $query .= (!empty($this->_curPre['reqid']) ? 'requestid, ' : '');
306
+        $query .= (!empty($this->_curPre['group_id']) ? 'groups_id, ' : '');
307
+        $query .= (!empty($this->_curPre['nuked']) ? 'nuked, ' : '');
308
+        $query .= (!empty($this->_curPre['filename']) ? 'filename, ' : '');
309 309
 
310 310
         $query .= 'predate, title) VALUES (';
311 311
 
312
-        $query .= (! empty($this->_curPre['size']) ? escapeString($this->_curPre['size']).', ' : '');
313
-        $query .= (! empty($this->_curPre['category']) ? escapeString($this->_curPre['category']).', ' : '');
314
-        $query .= (! empty($this->_curPre['source']) ? escapeString($this->_curPre['source']).', ' : '');
315
-        $query .= (! empty($this->_curPre['reason']) ? escapeString($this->_curPre['reason']).', ' : '');
316
-        $query .= (! empty($this->_curPre['files']) ? escapeString($this->_curPre['files']).', ' : '');
317
-        $query .= (! empty($this->_curPre['reqid']) ? $this->_curPre['reqid'].', ' : '');
318
-        $query .= (! empty($this->_curPre['group_id']) ? $this->_curPre['group_id'].', ' : '');
319
-        $query .= (! empty($this->_curPre['nuked']) ? $this->_curPre['nuked'].', ' : '');
320
-        $query .= (! empty($this->_curPre['filename']) ? escapeString($this->_curPre['filename']).', ' : '');
321
-        $query .= (! empty($this->_curPre['predate']) ? $this->_curPre['predate'].', ' : 'NOW(), ');
312
+        $query .= (!empty($this->_curPre['size']) ? escapeString($this->_curPre['size']).', ' : '');
313
+        $query .= (!empty($this->_curPre['category']) ? escapeString($this->_curPre['category']).', ' : '');
314
+        $query .= (!empty($this->_curPre['source']) ? escapeString($this->_curPre['source']).', ' : '');
315
+        $query .= (!empty($this->_curPre['reason']) ? escapeString($this->_curPre['reason']).', ' : '');
316
+        $query .= (!empty($this->_curPre['files']) ? escapeString($this->_curPre['files']).', ' : '');
317
+        $query .= (!empty($this->_curPre['reqid']) ? $this->_curPre['reqid'].', ' : '');
318
+        $query .= (!empty($this->_curPre['group_id']) ? $this->_curPre['group_id'].', ' : '');
319
+        $query .= (!empty($this->_curPre['nuked']) ? $this->_curPre['nuked'].', ' : '');
320
+        $query .= (!empty($this->_curPre['filename']) ? escapeString($this->_curPre['filename']).', ' : '');
321
+        $query .= (!empty($this->_curPre['predate']) ? $this->_curPre['predate'].', ' : 'NOW(), ');
322 322
 
323 323
         $query .= '%s)';
324 324
 
@@ -359,17 +359,17 @@  discard block
 block discarded – undo
359 359
 
360 360
         $query = 'UPDATE predb SET ';
361 361
 
362
-        $query .= (! empty($this->_curPre['size']) ? 'size = '.escapeString($this->_curPre['size']).', ' : '');
363
-        $query .= (! empty($this->_curPre['source']) ? 'source = '.escapeString($this->_curPre['source']).', ' : '');
364
-        $query .= (! empty($this->_curPre['files']) ? 'files = '.escapeString($this->_curPre['files']).', ' : '');
365
-        $query .= (! empty($this->_curPre['reason']) ? 'nukereason = '.escapeString($this->_curPre['reason']).', ' : '');
366
-        $query .= (! empty($this->_curPre['reqid']) ? 'requestid = '.$this->_curPre['reqid'].', ' : '');
367
-        $query .= (! empty($this->_curPre['group_id']) ? 'groups_id = '.$this->_curPre['group_id'].', ' : '');
368
-        $query .= (! empty($this->_curPre['predate']) ? 'predate = '.$this->_curPre['predate'].', ' : '');
369
-        $query .= (! empty($this->_curPre['nuked']) ? 'nuked = '.$this->_curPre['nuked'].', ' : '');
370
-        $query .= (! empty($this->_curPre['filename']) ? 'filename = '.escapeString($this->_curPre['filename']).', ' : '');
362
+        $query .= (!empty($this->_curPre['size']) ? 'size = '.escapeString($this->_curPre['size']).', ' : '');
363
+        $query .= (!empty($this->_curPre['source']) ? 'source = '.escapeString($this->_curPre['source']).', ' : '');
364
+        $query .= (!empty($this->_curPre['files']) ? 'files = '.escapeString($this->_curPre['files']).', ' : '');
365
+        $query .= (!empty($this->_curPre['reason']) ? 'nukereason = '.escapeString($this->_curPre['reason']).', ' : '');
366
+        $query .= (!empty($this->_curPre['reqid']) ? 'requestid = '.$this->_curPre['reqid'].', ' : '');
367
+        $query .= (!empty($this->_curPre['group_id']) ? 'groups_id = '.$this->_curPre['group_id'].', ' : '');
368
+        $query .= (!empty($this->_curPre['predate']) ? 'predate = '.$this->_curPre['predate'].', ' : '');
369
+        $query .= (!empty($this->_curPre['nuked']) ? 'nuked = '.$this->_curPre['nuked'].', ' : '');
370
+        $query .= (!empty($this->_curPre['filename']) ? 'filename = '.escapeString($this->_curPre['filename']).', ' : '');
371 371
         $query .= (
372
-            (empty($this->_oldPre['category']) && ! empty($this->_curPre['category']))
372
+            (empty($this->_oldPre['category']) && !empty($this->_curPre['category']))
373 373
                 ? 'category = '.escapeString($this->_curPre['category']).', '
374 374
                 : ''
375 375
         );
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
      */
405 405
     protected function _doEcho(bool $new = true): void
406 406
     {
407
-        if (! $this->_silent) {
407
+        if (!$this->_silent) {
408 408
             $nukeString = '';
409 409
             if ($this->_nuked !== false) {
410 410
                 switch ((int) $this->_curPre['nuked']) {
@@ -439,15 +439,15 @@  discard block
 block discarded – undo
439 439
                 $this->_curPre['title'].
440 440
                 ']'.
441 441
                 (
442
-                    ! empty($this->_curPre['category'])
442
+                    !empty($this->_curPre['category'])
443 443
                     ? ' ['.$this->_curPre['category'].']'
444 444
                     : (
445
-                        ! empty($this->_oldPre['category'])
445
+                        !empty($this->_oldPre['category'])
446 446
                         ? ' ['.$this->_oldPre['category'].']'
447 447
                         : ''
448 448
                     )
449 449
                 ).
450
-                (! empty($this->_curPre['size']) ? ' ['.$this->_curPre['size'].']' : '').
450
+                (!empty($this->_curPre['size']) ? ' ['.$this->_curPre['size'].']' : '').
451 451
                 PHP_EOL;
452 452
         }
453 453
     }
@@ -457,7 +457,7 @@  discard block
 block discarded – undo
457 457
      */
458 458
     protected function _getGroupID(string $groupName): mixed
459 459
     {
460
-        if (! isset($this->_groupList[$groupName])) {
460
+        if (!isset($this->_groupList[$groupName])) {
461 461
             $group = UsenetGroup::query()->where('name', $groupName)->first(['id']);
462 462
             $this->_groupList[$groupName] = $group !== null ? $group['id'] : '';
463 463
         }
Please login to merge, or discard this patch.
Blacklight/NNTP.php 1 patch
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         ];
152 152
         $primaryConnections = $this->_tmux->getUSPConnections('primary', $primaryUSP);
153 153
         $alternateConnections = $this->_tmux->getUSPConnections('alternate', $alternateUSP);
154
-        if ($this->_isConnected() && (($alternate && $this->_currentServer === config('nntmux_nntp.alternate_server') && ($this->_primaryNntpConnections < $alternateConnections['alternate']['active'])) || (! $alternate && $this->_currentServer === config('nntmux_nntp.server') && ($this->_primaryNntpConnections < $primaryConnections['primary']['active'])))) {
154
+        if ($this->_isConnected() && (($alternate && $this->_currentServer === config('nntmux_nntp.alternate_server') && ($this->_primaryNntpConnections < $alternateConnections['alternate']['active'])) || (!$alternate && $this->_currentServer === config('nntmux_nntp.server') && ($this->_primaryNntpConnections < $primaryConnections['primary']['active'])))) {
155 155
             return true;
156 156
         }
157 157
 
@@ -160,20 +160,20 @@  discard block
 block discarded – undo
160 160
         $ret = $connected = $cError = $aError = false;
161 161
 
162 162
         // Set variables to connect based on if we are using the alternate provider or not.
163
-        if (! $alternate) {
163
+        if (!$alternate) {
164 164
             $sslEnabled = (bool) config('nntmux_nntp.ssl');
165 165
             $this->_currentServer = config('nntmux_nntp.server');
166 166
             $this->_currentPort = config('nntmux_nntp.port');
167 167
             $userName = config('nntmux_nntp.username');
168 168
             $password = config('nntmux_nntp.password');
169
-            $socketTimeout = ! empty(config('nntmux_nntp.socket_timeout')) ? config('nntmux_nntp.socket_timeout') : $this->_socketTimeout;
169
+            $socketTimeout = !empty(config('nntmux_nntp.socket_timeout')) ? config('nntmux_nntp.socket_timeout') : $this->_socketTimeout;
170 170
         } else {
171 171
             $sslEnabled = (bool) config('nntmux_nntp.alternate_server_ssl');
172 172
             $this->_currentServer = config('nntmux_nntp.alternate_server');
173 173
             $this->_currentPort = config('nntmux_nntp.alternate_server_port');
174 174
             $userName = config('nntmux_nntp.alternate_server_username');
175 175
             $password = config('nntmux_nntp.alternate_server_password');
176
-            $socketTimeout = ! empty(config('nntmux_nntp.alternate_server_socket_timeout')) ? config('nntmux_nntp.alternate_server_socket_timeout') : $this->_socketTimeout;
176
+            $socketTimeout = !empty(config('nntmux_nntp.alternate_server_socket_timeout')) ? config('nntmux_nntp.alternate_server_socket_timeout') : $this->_socketTimeout;
177 177
         }
178 178
 
179 179
         $enc = ($sslEnabled ? ' (ssl)' : ' (non-ssl)');
@@ -186,19 +186,19 @@  discard block
 block discarded – undo
186 186
             $authenticated = false;
187 187
 
188 188
             // If we are not connected, try to connect.
189
-            if (! $connected) {
189
+            if (!$connected) {
190 190
                 $ret = $this->connect($this->_currentServer, $sslEnabled, $this->_currentPort, 5, $socketTimeout);
191 191
             }
192 192
             // Check if we got an error while connecting.
193 193
             $cErr = self::isError($ret);
194 194
 
195 195
             // If no error, we are connected.
196
-            if (! $cErr) {
196
+            if (!$cErr) {
197 197
                 // Say that we are connected so we don't retry.
198 198
                 $connected = true;
199 199
                 // When there is no error it returns bool if we are allowed to post or not.
200 200
                 $this->_postingAllowed = $ret;
201
-            } elseif (! $cError) {
201
+            } elseif (!$cError) {
202 202
                 $cError = $ret->getMessage();
203 203
             }
204 204
 
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
             }
209 209
 
210 210
             // If we have no more retries and could not connect, return an error.
211
-            if ($retries === 0 && ! $connected) {
211
+            if ($retries === 0 && !$connected) {
212 212
                 $message =
213 213
                     'Cannot connect to server '.
214 214
                     $this->_currentServer.
@@ -233,9 +233,9 @@  discard block
 block discarded – undo
233 233
                     $aErr = self::isError($ret2);
234 234
 
235 235
                     // If there was no error, then we are authenticated.
236
-                    if (! $aErr) {
236
+                    if (!$aErr) {
237 237
                         $authenticated = true;
238
-                    } elseif (! $aError) {
238
+                    } elseif (!$aError) {
239 239
                         $aError = $ret2->getMessage();
240 240
                     }
241 241
 
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
                     }
246 246
 
247 247
                     // If we ran out of retries, return an error.
248
-                    if ($retries === 0 && ! $authenticated) {
248
+                    if ($retries === 0 && !$authenticated) {
249 249
                         $message =
250 250
                             'Cannot authenticate to server '.
251 251
                             $this->_currentServer.
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
             // If we are connected and authenticated, try enabling compression if we have it enabled.
262 262
             if ($connected && $authenticated) {
263 263
                 // Check if we should use compression on the connection.
264
-                if (! $compression || (int) Settings::settingValue('..compressedheaders') === 0) {
264
+                if (!$compression || (int) Settings::settingValue('..compressedheaders') === 0) {
265 265
                     $this->_compressionSupported = false;
266 266
                 }
267 267
 
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
                 $message = $this->_getMessage($groupName, $wanted);
544 544
 
545 545
                 // Append the body to $body.
546
-                if (! self::isError($message)) {
546
+                if (!self::isError($message)) {
547 547
                     $body .= $message;
548 548
 
549 549
                     if ($messageSize === 0) {
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
 
553 553
                     // If there is an error try the alternate provider or return the PEAR error.
554 554
                 } elseif ($alternate) {
555
-                    if (! $aConnected) {
555
+                    if (!$aConnected) {
556 556
                         // Check if the current connected server is the alternate or not.
557 557
                         $aConnected = $this->_currentServer === config('nntmux_nntp.server') ? $nntp->doConnect(true, true) : $nntp->doConnect();
558 558
                     }
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
         }
639 639
 
640 640
         // Check if it's an article number or message-ID.
641
-        if (! is_numeric($identifier)) {
641
+        if (!is_numeric($identifier)) {
642 642
             // If it's a message-ID, check if it has the required triangular brackets.
643 643
             $identifier = $this->_formatMessageID($identifier);
644 644
         }
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
             $emptyLine = false;
659 659
             foreach ($article as $line) {
660 660
                 // If we found the empty line it means we are done reading the header and we will start reading the body.
661
-                if (! $emptyLine) {
661
+                if (!$emptyLine) {
662 662
                     if ($line === '') {
663 663
                         $emptyLine = true;
664 664
 
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
         }
717 717
 
718 718
         // Check if it's an article number or message-id.
719
-        if (! is_numeric($identifier)) {
719
+        if (!is_numeric($identifier)) {
720 720
             // Verify we have the required triangular brackets if it is a message-id.
721 721
             $identifier = $this->_formatMessageID($identifier);
722 722
         }
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
      */
767 767
     public function postArticle(array|string $groups, string $subject, \Exception|string $body, string $from, bool $yEnc = true, bool $compress = true, string $extra = ''): mixed
768 768
     {
769
-        if (! $this->_postingAllowed) {
769
+        if (!$this->_postingAllowed) {
770 770
             $message = 'You do not have the right to post articles on server '.$this->_currentServer;
771 771
 
772 772
             return $this->throwError($this->colorCli->climate()->error($message));
@@ -900,7 +900,7 @@  discard block
 block discarded – undo
900 900
         if ($this->_compressionEnabled) {
901 901
             return true;
902 902
         }
903
-        if (! $this->_compressionSupported) {
903
+        if (!$this->_compressionSupported) {
904 904
             return false;
905 905
         }
906 906
 
@@ -914,7 +914,7 @@  discard block
 block discarded – undo
914 914
             return $response;
915 915
         }
916 916
         if ($response !== 290) {
917
-            if (! $secondTry) {
917
+            if (!$secondTry) {
918 918
                 // Retry.
919 919
                 $this->cmdQuit();
920 920
                 if ($this->_checkConnection()) {
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
972 972
         $possibleTerm = false;
973 973
         $data = null;
974 974
 
975
-        while (! feof($this->_socket)) {
975
+        while (!feof($this->_socket)) {
976 976
             // Did we find a possible ending ? (.\r\n)
977 977
             if ($possibleTerm) {
978 978
                 // Loop, sleeping shortly, to allow the server time to upload data, if it has any.
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
                     stream_set_blocking($this->_socket, 1);
988 988
 
989 989
                     // Don't sleep on last iteration.
990
-                    if (! empty($buffer)) {
990
+                    if (!empty($buffer)) {
991 991
                         break;
992 992
                     }
993 993
                     if ($i < 2) {
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
                     // Remove .\r\n from end, decompress data.
1001 1001
                     $deComp = @gzuncompress(mb_substr($data, 0, -3, '8bit'));
1002 1002
 
1003
-                    if (! empty($deComp)) {
1003
+                    if (!empty($deComp)) {
1004 1004
                         $bytesReceived = \strlen($data);
1005 1005
                         if ($this->_echo && $bytesReceived > 10240) {
1006 1006
                             $this->colorCli->climate()->primaryOver(
@@ -1072,7 +1072,7 @@  discard block
 block discarded – undo
1072 1072
         }
1073 1073
 
1074 1074
         // Check if the last char is >, if not add it.
1075
-        if (! str_ends_with($messageID, '>')) {
1075
+        if (!str_ends_with($messageID, '>')) {
1076 1076
             $messageID .= '>';
1077 1077
         }
1078 1078
 
@@ -1099,7 +1099,7 @@  discard block
 block discarded – undo
1099 1099
         }
1100 1100
 
1101 1101
         // Check if this is an article number or message-id.
1102
-        if (! is_numeric($identifier)) {
1102
+        if (!is_numeric($identifier)) {
1103 1103
             // It's a message-id so check if it has the triangular brackets.
1104 1104
             $identifier = $this->_formatMessageID($identifier);
1105 1105
         }
@@ -1113,7 +1113,7 @@  discard block
 block discarded – undo
1113 1113
         $body = '';
1114 1114
         if ($response === NET_NNTP_PROTOCOL_RESPONSECODE_BODY_FOLLOWS) {
1115 1115
             // Continue until connection is lost
1116
-            while (! feof($this->_socket)) {
1116
+            while (!feof($this->_socket)) {
1117 1117
                 // Retrieve and append up to 1024 characters from the server.
1118 1118
                 $line = fgets($this->_socket, 1024);
1119 1119
 
@@ -1363,6 +1363,6 @@  discard block
 block discarded – undo
1363 1363
      */
1364 1364
     public function _isConnected(bool $feOf = true): bool
1365 1365
     {
1366
-        return is_resource($this->_socket) && (! $feOf || ! feof($this->_socket));
1366
+        return is_resource($this->_socket) && (!$feOf || !feof($this->_socket));
1367 1367
     }
1368 1368
 }
Please login to merge, or discard this patch.
Blacklight/ReleaseCleaning.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
                 foreach ($hit as $val) {
115 115
                     $title = Predb::query()->where('title', trim($val))->first(['title', 'id']);
116 116
                     // don't match against ab.teevee if title is for just the season
117
-                    if (! empty($title) && $groupName === 'alt.binaries.teevee' && preg_match('/\.S\d\d\./', $title['title'], $hit)) {
117
+                    if (!empty($title) && $groupName === 'alt.binaries.teevee' && preg_match('/\.S\d\d\./', $title['title'], $hit)) {
118 118
                         $title = null;
119 119
                     }
120 120
                     if ($title !== null) {
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
                     }
159 159
                     break;
160 160
             }
161
-            if ($title === null && ! empty($reqGname)) {
161
+            if ($title === null && !empty($reqGname)) {
162 162
                 $title = Predb::query()->where(['predb.requestid' => $hit[1], 'g.name' => $reqGname])->join('usenet_groups as g', 'g.id', '=', 'predb.groups_id')->first(['predb.title', 'predb.id']);
163 163
             }
164 164
             // don't match against ab.teevee if title is for just the season
Please login to merge, or discard this patch.
Blacklight/Contents.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@
 block discarded – undo
143 143
             $content['url'] = '/'.$content['url'];
144 144
         }
145 145
 
146
-        if (! str_ends_with($content['url'], '/')) {
146
+        if (!str_ends_with($content['url'], '/')) {
147 147
             $content['url'] .= '/';
148 148
         }
149 149
 
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.
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|Blu-Ray)|BD[._ -]?(25|50)?|\bBR\b|Camrip|[._ -]\d{4}[._ -].+(720p|1080p|Cam|HDTS|2160p)|DIVX|[._ -]DVD[._ -]|DVD-?(5|9|R|Rip)|Untouched|VHSRip|XVID|[._ -](DTS|TVrip|webrip|WEBDL|WEB-DL)[._ -]|\b(2160)p\b.*\b(Netflix|Amazon|NF|AMZN|Disney)\b/i', $this->releaseName) && ! preg_match('/s\d{1,3}[._ -]?[ed]\d{1,3}|auto(cad|desk)|divx[._ -]plus|[._ -]exe$|[._ -](jav|XXX)[._ -]|SWE6RUS|\wXXX(1080p|720p|DVD)|Xilisoft|\.S[0-9]\d{1,3}\./i', $this->releaseName)) {
287
+        if (preg_match('/[._ -]AVC|[BH][DR]RIP|(Bluray|Blu-Ray)|BD[._ -]?(25|50)?|\bBR\b|Camrip|[._ -]\d{4}[._ -].+(720p|1080p|Cam|HDTS|2160p)|DIVX|[._ -]DVD[._ -]|DVD-?(5|9|R|Rip)|Untouched|VHSRip|XVID|[._ -](DTS|TVrip|webrip|WEBDL|WEB-DL)[._ -]|\b(2160)p\b.*\b(Netflix|Amazon|NF|AMZN|Disney)\b/i', $this->releaseName) && !preg_match('/s\d{1,3}[._ -]?[ed]\d{1,3}|auto(cad|desk)|divx[._ -]plus|[._ -]exe$|[._ -](jav|XXX)[._ -]|SWE6RUS|\wXXX(1080p|720p|DVD)|Xilisoft|\.S[0-9]\d{1,3}\./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) && stripos($this->releaseName, '2160p') !== false) {
376
+        if (!preg_match('/(S\d+).*(2160p).*(Netflix|Amazon).*(TrollUHD|NTb|VLAD)/i', $this->releaseName) && stripos($this->releaseName, '2160p') !== false) {
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/libraries/Forking.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -273,14 +273,14 @@  discard block
 block discarded – undo
273 273
         $this->processWork();
274 274
         $maxWork = \count($this->work);
275 275
         foreach ($this->work as $group) {
276
-            $pool->add(function () use ($group) {
276
+            $pool->add(function() use ($group) {
277 277
                 return $this->_executeCommand(PHP_BINARY.' misc/update/backfill.php '.$group->name.(isset($group->max) ? (' '.$group->max) : ''));
278
-            }, 2000000)->then(function ($output) use ($group, $maxWork) {
278
+            }, 2000000)->then(function($output) use ($group, $maxWork) {
279 279
                 echo $output;
280 280
                 $this->colorCli->primary('Task #'.$maxWork.' Backfilled group '.$group->name);
281
-            })->catch(function (\Throwable $exception) {
281
+            })->catch(function(\Throwable $exception) {
282 282
                 echo $exception->getMessage();
283
-            })->catch(static function (SerializableException $serializableException) {
283
+            })->catch(static function(SerializableException $serializableException) {
284 284
                 //we do nothing here just catch the error and move on
285 285
             });
286 286
             $maxWork--;
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
         );
347 347
 
348 348
         $count = 0;
349
-        if (! empty($data) && isset($data[0]->name)) {
349
+        if (!empty($data) && isset($data[0]->name)) {
350 350
             $this->safeBackfillGroup = $data[0]->name;
351 351
 
352 352
             $count = ($data[0]->our_first - $data[0]->their_first);
@@ -368,14 +368,14 @@  discard block
 block discarded – undo
368 368
 
369 369
             $this->processWork();
370 370
             foreach ($queues as $queue) {
371
-                $pool->add(function () use ($queue) {
371
+                $pool->add(function() use ($queue) {
372 372
                     return $this->_executeCommand($this->dnr_path.$queue.'"');
373
-                }, 2000000)->then(function ($output) {
373
+                }, 2000000)->then(function($output) {
374 374
                     echo $output;
375 375
                     $this->colorCli->primary('Backfilled group '.$this->safeBackfillGroup);
376
-                })->catch(function (\Throwable $exception) {
376
+                })->catch(function(\Throwable $exception) {
377 377
                     echo $exception->getMessage();
378
-                })->catch(static function (SerializableException $serializableException) {
378
+                })->catch(static function(SerializableException $serializableException) {
379 379
                     //we do nothing here just catch the error and move on
380 380
                 });
381 381
             }
@@ -408,14 +408,14 @@  discard block
 block discarded – undo
408 408
 
409 409
         $this->processWork();
410 410
         foreach ($this->work as $group) {
411
-            $pool->add(function () use ($group) {
411
+            $pool->add(function() use ($group) {
412 412
                 return $this->_executeCommand(PHP_BINARY.' misc/update/update_binaries.php '.$group->name.' '.$group->max);
413
-            }, 2000000)->then(function ($output) use ($group, $maxWork) {
413
+            }, 2000000)->then(function($output) use ($group, $maxWork) {
414 414
                 echo $output;
415 415
                 $this->colorCli->primary('Task #'.$maxWork.' Updated group '.$group->name);
416
-            })->catch(function (\Throwable $exception) {
416
+            })->catch(function(\Throwable $exception) {
417 417
                 echo $exception->getMessage();
418
-            })->catch(static function (SerializableException $serializableException) {
418
+            })->catch(static function(SerializableException $serializableException) {
419 419
                 //we do nothing here just catch the error and move on
420 420
             });
421 421
             $maxWork--;
@@ -442,7 +442,7 @@  discard block
 block discarded – undo
442 442
 			ORDER BY a.last_record DESC'
443 443
         );
444 444
 
445
-        if (! empty($this->work)) {
445
+        if (!empty($this->work)) {
446 446
             $i = 1;
447 447
             $queues = [];
448 448
             foreach ($this->work as $group) {
@@ -475,16 +475,16 @@  discard block
 block discarded – undo
475 475
             $this->processWork();
476 476
             foreach ($queues as $queue) {
477 477
                 preg_match('/alt\..+/i', $queue, $hit);
478
-                $pool->add(function () use ($queue) {
478
+                $pool->add(function() use ($queue) {
479 479
                     return $this->_executeCommand($this->dnr_path.$queue.'"');
480
-                }, 2000000)->then(function ($output) use ($hit) {
481
-                    if (! empty($hit)) {
480
+                }, 2000000)->then(function($output) use ($hit) {
481
+                    if (!empty($hit)) {
482 482
                         echo $output;
483 483
                         $this->colorCli->primary('Updated group '.$hit[0]);
484 484
                     }
485
-                })->catch(function (\Throwable $exception) {
485
+                })->catch(function(\Throwable $exception) {
486 486
                     echo $exception->getMessage();
487
-                })->catch(static function (SerializableException $serializableException) {
487
+                })->catch(static function(SerializableException $serializableException) {
488 488
                     //we do nothing here just catch the error and move on
489 489
                 });
490 490
             }
@@ -547,14 +547,14 @@  discard block
 block discarded – undo
547 547
 
548 548
         $this->processWork();
549 549
         foreach ($this->work as $queue) {
550
-            $pool->add(function () use ($queue) {
550
+            $pool->add(function() use ($queue) {
551 551
                 return $this->_executeCommand(PHP_BINARY.' misc/update/tmux/bin/groupfixrelnames.php "'.$queue.'"'.' true');
552
-            }, 2000000)->then(function ($output) use ($maxWork) {
552
+            }, 2000000)->then(function($output) use ($maxWork) {
553 553
                 echo $output;
554 554
                 $this->colorCli->primary('Task #'.$maxWork.' Finished fixing releases names');
555
-            })->catch(function (\Throwable $exception) {
555
+            })->catch(function(\Throwable $exception) {
556 556
                 echo $exception->getMessage();
557
-            })->catch(static function (SerializableException $serializableException) {
557
+            })->catch(static function(SerializableException $serializableException) {
558 558
                 //we do nothing here just catch the error and move on
559 559
             });
560 560
             $maxWork--;
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
         foreach ($work as $group) {
576 576
             try {
577 577
                 $query = DB::select(sprintf('SELECT id FROM collections WHERE groups_id = %d LIMIT 1', $group->id));
578
-                if (! empty($query)) {
578
+                if (!empty($query)) {
579 579
                     $uGroups[] = ['id' => $group->id, 'name' => $group->name];
580 580
                 }
581 581
             } catch (\PDOException $e) {
@@ -593,14 +593,14 @@  discard block
 block discarded – undo
593 593
 
594 594
         $this->processWork();
595 595
         foreach ($uGroups as $group) {
596
-            $pool->add(function () use ($group) {
596
+            $pool->add(function() use ($group) {
597 597
                 return $this->_executeCommand($this->dnr_path.'releases  '.$group['id'].'"');
598
-            }, 2000000)->then(function ($output) use ($maxWork) {
598
+            }, 2000000)->then(function($output) use ($maxWork) {
599 599
                 echo $output;
600 600
                 $this->colorCli->primary('Task #'.$maxWork.' Finished performing release processing');
601
-            })->catch(function (\Throwable $exception) {
601
+            })->catch(function(\Throwable $exception) {
602 602
                 echo $exception->getMessage();
603
-            })->catch(static function (SerializableException $serializableException) {
603
+            })->catch(static function(SerializableException $serializableException) {
604 604
                 //we do nothing here just catch the error and move on
605 605
             });
606 606
             $maxWork--;
@@ -637,16 +637,16 @@  discard block
 block discarded – undo
637 637
         $this->processWork();
638 638
         foreach ($releases as $release) {
639 639
             if ($type !== '') {
640
-                $pool->add(function () use ($release, $type) {
640
+                $pool->add(function() use ($release, $type) {
641 641
                     return $this->_executeCommand(PHP_BINARY.' misc/update/postprocess.php '.$type.$release->id);
642
-                }, 2000000)->then(function ($output) use ($desc, $count) {
642
+                }, 2000000)->then(function($output) use ($desc, $count) {
643 643
                     echo $output;
644 644
                     $this->colorCli->primary('Finished task #'.$count.' for '.$desc);
645
-                })->catch(function (\Throwable $exception) {
645
+                })->catch(function(\Throwable $exception) {
646 646
                     echo $exception->getMessage();
647
-                })->catch(static function (SerializableException $serializableException) {
647
+                })->catch(static function(SerializableException $serializableException) {
648 648
                     //we do nothing here just catch the error and move on
649
-                })->timeout(function () use ($count) {
649
+                })->timeout(function() use ($count) {
650 650
                     $this->colorCli->notice('Task #'.$count.': Timeout occurred.');
651 651
                 });
652 652
                 $count--;
@@ -894,15 +894,15 @@  discard block
 block discarded – undo
894 894
         $pool = Pool::create()->concurrency($maxProcess)->timeout(config('nntmux.multiprocessing_max_child_time'));
895 895
         $this->processWork();
896 896
         foreach ($this->work as $group) {
897
-            $pool->add(function () use ($group) {
897
+            $pool->add(function() use ($group) {
898 898
                 return $this->_executeCommand($this->dnr_path.'update_per_group  '.$group->id.'"');
899
-            }, 2000000)->then(function ($output) use ($group) {
899
+            }, 2000000)->then(function($output) use ($group) {
900 900
                 echo $output;
901 901
                 $name = UsenetGroup::getNameByID($group->id);
902 902
                 $this->colorCli->primary('Finished updating binaries, processing releases and additional postprocessing for group:'.$name);
903
-            })->catch(function (\Throwable $exception) {
903
+            })->catch(function(\Throwable $exception) {
904 904
                 echo $exception->getMessage();
905
-            })->catch(static function (SerializableException $serializableException) {
905
+            })->catch(static function(SerializableException $serializableException) {
906 906
                 echo $serializableException->asThrowable()->getMessage();
907 907
             });
908 908
         }
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
     {
919 919
         $process = Process::fromShellCommandline($command);
920 920
         $process->setTimeout(1800);
921
-        $process->run(function ($type, $buffer) {
921
+        $process->run(function($type, $buffer) {
922 922
             if ($type === Process::ERR) {
923 923
                 echo $buffer;
924 924
             }
Please login to merge, or discard this patch.