@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | $colorCli = new ColorCLI; |
| 18 | 18 | |
| 19 | -if (! isset($argv[1])) { |
|
| 19 | +if (!isset($argv[1])) { |
|
| 20 | 20 | $colorCli->error('This script is not intended to be run manually, it is called from Multiprocessing.'); |
| 21 | 21 | exit(1); |
| 22 | 22 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | switch ($type) { |
| 31 | 31 | case 'standard': |
| 32 | - if ($guidChar === null || $maxPerRun === null || ! is_numeric($maxPerRun)) { |
|
| 32 | + if ($guidChar === null || $maxPerRun === null || !is_numeric($maxPerRun)) { |
|
| 33 | 33 | $colorCli->error('Invalid arguments for standard type'); |
| 34 | 34 | exit(1); |
| 35 | 35 | } |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | break; |
| 39 | 39 | |
| 40 | 40 | case 'predbft': |
| 41 | - if (! isset($maxPerRun) || ! is_numeric($maxPerRun) || ! isset($thread) || ! is_numeric($thread)) { |
|
| 41 | + if (!isset($maxPerRun) || !is_numeric($maxPerRun) || !isset($thread) || !is_numeric($thread)) { |
|
| 42 | 42 | $colorCli->error('Invalid arguments for predbft type'); |
| 43 | 43 | exit(1); |
| 44 | 44 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | protected function buildFullLayout(): bool |
| 41 | 41 | { |
| 42 | 42 | // Window 0: Monitor + Binaries + Backfill + Releases |
| 43 | - if (! $this->sessionManager->createSession('Monitor')) { |
|
| 43 | + if (!$this->sessionManager->createSession('Monitor')) { |
|
| 44 | 44 | return false; |
| 45 | 45 | } |
| 46 | 46 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | protected function buildBasicLayout(): bool |
| 83 | 83 | { |
| 84 | 84 | // Window 0: Monitor + Releases |
| 85 | - if (! $this->sessionManager->createSession('Monitor')) { |
|
| 85 | + if (!$this->sessionManager->createSession('Monitor')) { |
|
| 86 | 86 | return false; |
| 87 | 87 | } |
| 88 | 88 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | protected function buildStrippedLayout(): bool |
| 117 | 117 | { |
| 118 | 118 | // Window 0: Monitor + Sequential |
| 119 | - if (! $this->sessionManager->createSession('Monitor')) { |
|
| 119 | + if (!$this->sessionManager->createSession('Monitor')) { |
|
| 120 | 120 | return false; |
| 121 | 121 | } |
| 122 | 122 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $silent = $this->option('quiet'); |
| 38 | 38 | $debug = $this->option('debug'); |
| 39 | 39 | |
| 40 | - if (! $silent) { |
|
| 40 | + if (!$silent) { |
|
| 41 | 41 | $this->info('Starting IRC Scraper...'); |
| 42 | 42 | if ($debug) { |
| 43 | 43 | $this->warn('Debug mode enabled'); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | return self::SUCCESS; |
| 51 | 51 | } catch (\Exception $e) { |
| 52 | - if (! $silent) { |
|
| 52 | + if (!$silent) { |
|
| 53 | 53 | $this->error($e->getMessage()); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | $blacklistId = $this->option('blacklist-id') ?? ''; |
| 28 | 28 | $delete = $this->option('delete'); |
| 29 | 29 | |
| 30 | - if (! $delete) { |
|
| 30 | + if (!$delete) { |
|
| 31 | 31 | $this->warn('Running in DRY-RUN mode. Use --delete to actually remove releases.'); |
| 32 | 32 | } |
| 33 | 33 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | // Handle fix_crap checkbox array - convert to comma-separated string |
| 26 | 26 | if (isset($data['fix_crap']) && is_array($data['fix_crap'])) { |
| 27 | 27 | $data['fix_crap'] = implode(',', $data['fix_crap']); |
| 28 | - } elseif (! isset($data['fix_crap'])) { |
|
| 28 | + } elseif (!isset($data['fix_crap'])) { |
|
| 29 | 29 | // If no checkboxes selected, save empty string |
| 30 | 30 | $data['fix_crap'] = ''; |
| 31 | 31 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | |
| 54 | 54 | // Parse fix_crap setting into an array |
| 55 | 55 | $fixCrapSetting = $this->runVar['settings']['fix_crap'] ?? ''; |
| 56 | - $fixCrapTypes = ! empty($fixCrapSetting) |
|
| 56 | + $fixCrapTypes = !empty($fixCrapSetting) |
|
| 57 | 57 | ? (is_array($fixCrapSetting) ? $fixCrapSetting : explode(',', $fixCrapSetting)) |
| 58 | 58 | : []; |
| 59 | 59 | $fixCrapTypes = array_filter($fixCrapTypes); |
@@ -54,16 +54,16 @@ discard block |
||
| 54 | 54 | $enabled = $config['enabled'] ?? true; |
| 55 | 55 | $workAvailable = $config['work_available'] ?? true; |
| 56 | 56 | |
| 57 | - if (! $pane || ! $command) { |
|
| 57 | + if (!$pane || !$command) { |
|
| 58 | 58 | return false; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | // Check if task is enabled and has work |
| 62 | - if (! $enabled) { |
|
| 62 | + if (!$enabled) { |
|
| 63 | 63 | return $this->disablePane($pane, $taskName, 'disabled in settings'); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - if (! $workAvailable) { |
|
| 66 | + if (!$workAvailable) { |
|
| 67 | 67 | return $this->disablePane($pane, $taskName, 'no work available'); |
| 68 | 68 | } |
| 69 | 69 | |
@@ -129,13 +129,13 @@ discard block |
||
| 129 | 129 | { |
| 130 | 130 | $logsEnabled = (int) Settings::settingValue('write_logs') === 1; |
| 131 | 131 | |
| 132 | - if (! $logsEnabled) { |
|
| 132 | + if (!$logsEnabled) { |
|
| 133 | 133 | return '/dev/null'; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | $logDir = config('tmux.paths.logs', storage_path('logs/tmux')); |
| 137 | 137 | |
| 138 | - if (! is_dir($logDir)) { |
|
| 138 | + if (!is_dir($logDir)) { |
|
| 139 | 139 | mkdir($logDir, 0755, true); |
| 140 | 140 | } |
| 141 | 141 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $killswitch = $config['killswitch']['pp'] ?? false; |
| 203 | 203 | $pane = '0.1'; |
| 204 | 204 | |
| 205 | - if (! $enabled) { |
|
| 205 | + if (!$enabled) { |
|
| 206 | 206 | return $this->disablePane($pane, 'Update Binaries', 'disabled in settings'); |
| 207 | 207 | } |
| 208 | 208 | |
@@ -215,7 +215,7 @@ discard block |
||
| 215 | 215 | default => null, |
| 216 | 216 | }; |
| 217 | 217 | |
| 218 | - if (! $artisanCommand) { |
|
| 218 | + if (!$artisanCommand) { |
|
| 219 | 219 | return false; |
| 220 | 220 | } |
| 221 | 221 | |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | $ppKillswitch = $config['killswitch']['pp'] ?? false; |
| 238 | 238 | $pane = '0.2'; |
| 239 | 239 | |
| 240 | - if (! $enabled) { |
|
| 240 | + if (!$enabled) { |
|
| 241 | 241 | return $this->disablePane($pane, 'Backfill', 'disabled in settings'); |
| 242 | 242 | } |
| 243 | 243 | |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | default => null, |
| 252 | 252 | }; |
| 253 | 253 | |
| 254 | - if (! $artisanCommand) { |
|
| 254 | + if (!$artisanCommand) { |
|
| 255 | 255 | return false; |
| 256 | 256 | } |
| 257 | 257 | |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | $enabled = (int) ($config['settings']['releases_run'] ?? 0); |
| 280 | 280 | $pane = $config['pane'] ?? '0.3'; |
| 281 | 281 | |
| 282 | - if (! $enabled) { |
|
| 282 | + if (!$enabled) { |
|
| 283 | 283 | return $this->disablePane($pane, 'Update Releases', 'disabled in settings'); |
| 284 | 284 | } |
| 285 | 285 | |
@@ -437,7 +437,7 @@ discard block |
||
| 437 | 437 | |
| 438 | 438 | // Trim whitespace and filter out empty values and '0' |
| 439 | 439 | $types = array_map('trim', $types); |
| 440 | - $types = array_filter($types, fn ($type) => ! empty($type) && $type !== '0'); |
|
| 440 | + $types = array_filter($types, fn ($type) => !empty($type) && $type !== '0'); |
|
| 441 | 441 | |
| 442 | 442 | // Re-index array to ensure sequential keys |
| 443 | 443 | $types = array_values($types); |
@@ -483,7 +483,7 @@ discard block |
||
| 483 | 483 | */ |
| 484 | 484 | protected function loadCrapState(string $file): array |
| 485 | 485 | { |
| 486 | - if (! file_exists($file)) { |
|
| 486 | + if (!file_exists($file)) { |
|
| 487 | 487 | return ['first_run' => true]; |
| 488 | 488 | } |
| 489 | 489 | |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | protected function saveCrapState(string $file, array $state): void |
| 500 | 500 | { |
| 501 | 501 | $dir = dirname($file); |
| 502 | - if (! is_dir($dir)) { |
|
| 502 | + if (!is_dir($dir)) { |
|
| 503 | 503 | mkdir($dir, 0755, true); |
| 504 | 504 | } |
| 505 | 505 | |
@@ -653,7 +653,7 @@ discard block |
||
| 653 | 653 | || (int) ($runVar['counts']['now']['processgames'] ?? 0) > 0 |
| 654 | 654 | || (int) ($runVar['counts']['now']['processxxx'] ?? 0) > 0; |
| 655 | 655 | |
| 656 | - if (! $hasWork) { |
|
| 656 | + if (!$hasWork) { |
|
| 657 | 657 | return $this->disablePane($pane, 'Post-process Amazon', 'no music/books/games to process'); |
| 658 | 658 | } |
| 659 | 659 | |
@@ -34,13 +34,13 @@ |
||
| 34 | 34 | $renamed = $this->argument('renamed') ?? ''; |
| 35 | 35 | $mode = $this->option('mode') ?? 'pipeline'; |
| 36 | 36 | |
| 37 | - if (! $this->isValidChar($guid)) { |
|
| 37 | + if (!$this->isValidChar($guid)) { |
|
| 38 | 38 | $this->error('GUID character must be a-f or 0-9.'); |
| 39 | 39 | |
| 40 | 40 | return self::FAILURE; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | - if (! in_array($mode, ['pipeline', 'parallel'], true)) { |
|
| 43 | + if (!in_array($mode, ['pipeline', 'parallel'], true)) { |
|
| 44 | 44 | $this->error('Mode must be either "pipeline" or "parallel".'); |
| 45 | 45 | |
| 46 | 46 | return self::FAILURE; |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | use Symfony\Component\Process\Process; |
| 16 | 16 | use Zip as ZipStream; |
| 17 | 17 | |
| 18 | -if (! function_exists('getRawHtml')) { |
|
| 18 | +if (!function_exists('getRawHtml')) { |
|
| 19 | 19 | /** |
| 20 | 20 | * @param bool $cookie |
| 21 | 21 | * @return bool|mixed|string |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | -if (! function_exists('makeFieldLinks')) { |
|
| 53 | +if (!function_exists('makeFieldLinks')) { |
|
| 54 | 54 | /** |
| 55 | 55 | * @return string |
| 56 | 56 | * |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | } |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | -if (! function_exists('getUserBrowseOrder')) { |
|
| 83 | +if (!function_exists('getUserBrowseOrder')) { |
|
| 84 | 84 | /** |
| 85 | 85 | * @param string $orderBy |
| 86 | 86 | */ |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | -if (! function_exists('getUserBrowseOrdering')) { |
|
| 109 | +if (!function_exists('getUserBrowseOrdering')) { |
|
| 110 | 110 | function getUserBrowseOrdering(): array |
| 111 | 111 | { |
| 112 | 112 | return [ |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | -if (! function_exists('getSimilarName')) { |
|
| 139 | +if (!function_exists('getSimilarName')) { |
|
| 140 | 140 | /** |
| 141 | 141 | * @param string $name |
| 142 | 142 | */ |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | -if (! function_exists('human_filesize')) { |
|
| 149 | +if (!function_exists('human_filesize')) { |
|
| 150 | 150 | /** |
| 151 | 151 | * @param int $decimals |
| 152 | 152 | */ |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | -if (! function_exists('bcdechex')) { |
|
| 162 | +if (!function_exists('bcdechex')) { |
|
| 163 | 163 | /** |
| 164 | 164 | * @return string |
| 165 | 165 | */ |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | } |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | -if (! function_exists('runCmd')) { |
|
| 179 | +if (!function_exists('runCmd')) { |
|
| 180 | 180 | /** |
| 181 | 181 | * Run CLI command. |
| 182 | 182 | * |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | -if (! function_exists('escapeString')) { |
|
| 207 | +if (!function_exists('escapeString')) { |
|
| 208 | 208 | |
| 209 | 209 | function escapeString($string): string |
| 210 | 210 | { |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | } |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | -if (! function_exists('realDuration')) { |
|
| 215 | +if (!function_exists('realDuration')) { |
|
| 216 | 216 | |
| 217 | 217 | function realDuration($milliseconds): string |
| 218 | 218 | { |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | -if (! function_exists('is_it_json')) { |
|
| 225 | +if (!function_exists('is_it_json')) { |
|
| 226 | 226 | /** |
| 227 | 227 | * @throws JsonException |
| 228 | 228 | */ |
@@ -237,7 +237,7 @@ discard block |
||
| 237 | 237 | } |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | -if (! function_exists('getStreamingZip')) { |
|
| 240 | +if (!function_exists('getStreamingZip')) { |
|
| 241 | 241 | /** |
| 242 | 242 | * @throws Exception |
| 243 | 243 | */ |
@@ -264,7 +264,7 @@ discard block |
||
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | -if (! function_exists('release_flag')) { |
|
| 267 | +if (!function_exists('release_flag')) { |
|
| 268 | 268 | // Function inspired by c0r3@newznabforums adds country flags on the browse page. |
| 269 | 269 | /** |
| 270 | 270 | * @param string $text Text to match against. |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | } |
| 402 | 402 | } |
| 403 | 403 | |
| 404 | -if (! function_exists('getReleaseCover')) { |
|
| 404 | +if (!function_exists('getReleaseCover')) { |
|
| 405 | 405 | /** |
| 406 | 406 | * Get the cover image URL for a release based on its type and ID |
| 407 | 407 | * |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | $coverId = null; |
| 415 | 415 | |
| 416 | 416 | // Helper function to get value from object or array |
| 417 | - $getValue = function ($data, $key) { |
|
| 417 | + $getValue = function($data, $key) { |
|
| 418 | 418 | if (is_array($data)) { |
| 419 | 419 | return $data[$key] ?? null; |
| 420 | 420 | } elseif (is_object($data)) { |
@@ -433,25 +433,25 @@ discard block |
||
| 433 | 433 | $xxxinfo_id = $getValue($release, 'xxxinfo_id'); |
| 434 | 434 | $anidbid = $getValue($release, 'anidbid'); |
| 435 | 435 | |
| 436 | - if (! empty($imdbid) && $imdbid > 0) { |
|
| 436 | + if (!empty($imdbid) && $imdbid > 0) { |
|
| 437 | 437 | $coverType = 'movies'; |
| 438 | 438 | $coverId = str_pad($imdbid, 7, '0', STR_PAD_LEFT); |
| 439 | - } elseif (! empty($musicinfo_id)) { |
|
| 439 | + } elseif (!empty($musicinfo_id)) { |
|
| 440 | 440 | $coverType = 'music'; |
| 441 | 441 | $coverId = $musicinfo_id; |
| 442 | - } elseif (! empty($consoleinfo_id)) { |
|
| 442 | + } elseif (!empty($consoleinfo_id)) { |
|
| 443 | 443 | $coverType = 'console'; |
| 444 | 444 | $coverId = $consoleinfo_id; |
| 445 | - } elseif (! empty($bookinfo_id)) { |
|
| 445 | + } elseif (!empty($bookinfo_id)) { |
|
| 446 | 446 | $coverType = 'book'; |
| 447 | 447 | $coverId = $bookinfo_id; |
| 448 | - } elseif (! empty($gamesinfo_id)) { |
|
| 448 | + } elseif (!empty($gamesinfo_id)) { |
|
| 449 | 449 | $coverType = 'games'; |
| 450 | 450 | $coverId = $gamesinfo_id; |
| 451 | - } elseif (! empty($xxxinfo_id)) { |
|
| 451 | + } elseif (!empty($xxxinfo_id)) { |
|
| 452 | 452 | $coverType = 'xxx'; |
| 453 | 453 | $coverId = $xxxinfo_id; |
| 454 | - } elseif (! empty($anidbid)) { |
|
| 454 | + } elseif (!empty($anidbid)) { |
|
| 455 | 455 | $coverType = 'anime'; |
| 456 | 456 | $coverId = $anidbid; |
| 457 | 457 | } |
@@ -467,10 +467,10 @@ discard block |
||
| 467 | 467 | } |
| 468 | 468 | } |
| 469 | 469 | |
| 470 | -if (! function_exists('sanitize')) { |
|
| 470 | +if (!function_exists('sanitize')) { |
|
| 471 | 471 | function sanitize(array|string $phrases, array $doNotSanitize = []): string |
| 472 | 472 | { |
| 473 | - if (! is_array($phrases)) { |
|
| 473 | + if (!is_array($phrases)) { |
|
| 474 | 474 | $wordArray = explode(' ', str_replace('.', ' ', $phrases)); |
| 475 | 475 | } else { |
| 476 | 476 | $wordArray = $phrases; |
@@ -481,9 +481,9 @@ discard block |
||
| 481 | 481 | foreach ($wordArray as $words) { |
| 482 | 482 | $words = preg_split('/\s+/', $words); |
| 483 | 483 | foreach ($words as $st) { |
| 484 | - if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) { |
|
| 484 | + if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) { |
|
| 485 | 485 | $str = $st; |
| 486 | - } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) { |
|
| 486 | + } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) { |
|
| 487 | 487 | $str = $st; |
| 488 | 488 | } else { |
| 489 | 489 | $str = Sanitizer::escape($st, $doNotSanitize); |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | } |
| 499 | 499 | } |
| 500 | 500 | |
| 501 | -if (! function_exists('formatBytes')) { |
|
| 501 | +if (!function_exists('formatBytes')) { |
|
| 502 | 502 | /** |
| 503 | 503 | * Format bytes into human-readable file size. |
| 504 | 504 | * |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | } |
| 518 | 518 | } |
| 519 | 519 | |
| 520 | -if (! function_exists('csp_nonce')) { |
|
| 520 | +if (!function_exists('csp_nonce')) { |
|
| 521 | 521 | /** |
| 522 | 522 | * Generate a CSP nonce for inline scripts |
| 523 | 523 | * This should be stored in the request and reused across the request lifecycle |
@@ -534,7 +534,7 @@ discard block |
||
| 534 | 534 | } |
| 535 | 535 | } |
| 536 | 536 | |
| 537 | -if (! function_exists('userDate')) { |
|
| 537 | +if (!function_exists('userDate')) { |
|
| 538 | 538 | /** |
| 539 | 539 | * Format a date/time string according to the authenticated user's timezone |
| 540 | 540 | * |
@@ -566,7 +566,7 @@ discard block |
||
| 566 | 566 | } |
| 567 | 567 | } |
| 568 | 568 | |
| 569 | -if (! function_exists('userDateDiffForHumans')) { |
|
| 569 | +if (!function_exists('userDateDiffForHumans')) { |
|
| 570 | 570 | /** |
| 571 | 571 | * Format a date/time string as a human-readable diff according to the authenticated user's timezone |
| 572 | 572 | * |
@@ -597,7 +597,7 @@ discard block |
||
| 597 | 597 | } |
| 598 | 598 | } |
| 599 | 599 | |
| 600 | -if (! function_exists('getAvailableTimezones')) { |
|
| 600 | +if (!function_exists('getAvailableTimezones')) { |
|
| 601 | 601 | /** |
| 602 | 602 | * Get a list of available timezones grouped by region |
| 603 | 603 | * |