Passed
Push — master ( f57104...975251 )
by Darko
10:16
created
app/Services/Tmux/TmuxTaskRunner.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -54,16 +54,16 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/Console/Commands/PostProcessTvPipeline.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
app/Services/TvProcessor.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -13,9 +13,9 @@  discard block
 block discarded – undo
13 13
 class TvProcessor
14 14
 {
15 15
     // Processing modes
16
-    public const MODE_PIPELINE = 'pipeline';  // Sequential processing (efficient, reduces API calls)
16
+    public const MODE_PIPELINE = 'pipeline'; // Sequential processing (efficient, reduces API calls)
17 17
 
18
-    public const MODE_PARALLEL = 'parallel';  // Parallel processing (faster, more API calls)
18
+    public const MODE_PARALLEL = 'parallel'; // Parallel processing (faster, more API calls)
19 19
 
20 20
     private bool $echooutput;
21 21
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      */
134 134
     private function displayHeader(string $guidChar = ''): void
135 135
     {
136
-        if (! $this->echooutput) {
136
+        if (!$this->echooutput) {
137 137
             return;
138 138
         }
139 139
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      */
158 158
     private function displayHeaderParallel(string $guidChar = ''): void
159 159
     {
160
-        if (! $this->echooutput) {
160
+        if (!$this->echooutput) {
161 161
             return;
162 162
         }
163 163
 
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
      */
182 182
     private function displayProviderHeader(string $providerName, int $step, int $total): void
183 183
     {
184
-        if (! $this->echooutput) {
184
+        if (!$this->echooutput) {
185 185
             return;
186 186
         }
187 187
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
      */
201 201
     private function displayProviderComplete(string $providerName, float $elapsedTime): void
202 202
     {
203
-        if (! $this->echooutput) {
203
+        if (!$this->echooutput) {
204 204
             return;
205 205
         }
206 206
 
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
      */
219 219
     private function displaySummary(): void
220 220
     {
221
-        if (! $this->echooutput) {
221
+        if (!$this->echooutput) {
222 222
             return;
223 223
         }
224 224
 
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
      */
235 235
     private function displaySummaryParallel(float $totalTime): void
236 236
     {
237
-        if (! $this->echooutput) {
237
+        if (!$this->echooutput) {
238 238
             return;
239 239
         }
240 240
 
Please login to merge, or discard this patch.
app/Extensions/helper/helpers.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
      *
Please login to merge, or discard this patch.
app/Console/Commands/ProcessPostProcess.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
         $type = $this->argument('type');
35 35
         $renamed = $this->argument('renamed');
36 36
 
37
-        if (! \in_array($type, ['ama', 'add', 'ani', 'mov', 'nfo', 'tv'], true)) {
37
+        if (!\in_array($type, ['ama', 'add', 'ani', 'mov', 'nfo', 'tv'], true)) {
38 38
             $this->error('Type must be one of: ama, add, ani, mov, nfo, sha, tv');
39 39
             $this->line('');
40 40
             $this->line('ama => Do amazon/books processing');
Please login to merge, or discard this patch.
app/Console/Commands/UpdateNNTmuxComposer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
             $this->info('
Please login to merge, or discard this patch.
app/Console/Commands/TmuxAttach.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 
35 35
         $sessionManager = new TmuxSessionManager($sessionName);
36 36
 
37
-        if (! $sessionManager->sessionExists()) {
37
+        if (!$sessionManager->sessionExists()) {
38 38
             $this->error("❌ Session '{$sessionName}' does not exist");
39 39
             $this->info("
Please login to merge, or discard this patch.
app/Console/Commands/TmuxMonitor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
             $this->tmuxOutput = new TmuxOutput;
65 65
 
66 66
             // Verify session exists
67
-            if (! $this->sessionManager->sessionExists()) {
67
+            if (!$this->sessionManager->sessionExists()) {
68 68
                 $this->error("❌ Tmux session '{$sessionName}' does not exist.");
69 69
                 $this->info("
Please login to merge, or discard this patch.
app/Console/Commands/TmuxStart.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             $this->layoutBuilder = new TmuxLayoutBuilder($this->sessionManager);
56 56
 
57 57
             // Check if tmux is installed
58
-            if (! $this->checkTmuxInstalled()) {
58
+            if (!$this->checkTmuxInstalled()) {
59 59
                 $this->error('❌ tmux is not installed');
60 60
 
61 61
                 return Command::FAILURE;
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 
64 64
             // Check if session already exists
65 65
             if ($this->sessionManager->sessionExists()) {
66
-                if (! $this->option('force')) {
66
+                if (!$this->option('force')) {
67 67
                     $this->error("❌ Session '{$sessionName}' already exists");
68 68
                     if ($this->confirm('Would you like to restart it?', false)) {
69 69
                         $this->call('tmux:stop', ['--session' => $sessionName]);
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
             $this->info("
Please login to merge, or discard this patch.