@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $this->info(' |
@@ -87,16 +87,16 @@ discard block |
||
| 87 | 87 | { |
| 88 | 88 | $steps = 3; // prepare, finalize, cleanup |
| 89 | 89 | |
| 90 | - if (! $this->option('skip-git')) { |
|
| 90 | + if (!$this->option('skip-git')) { |
|
| 91 | 91 | $steps++; |
| 92 | 92 | } |
| 93 | - if (! $this->option('skip-composer')) { |
|
| 93 | + if (!$this->option('skip-composer')) { |
|
| 94 | 94 | $steps++; |
| 95 | 95 | } |
| 96 | - if (! $this->option('skip-npm')) { |
|
| 96 | + if (!$this->option('skip-npm')) { |
|
| 97 | 97 | $steps += 2; |
| 98 | 98 | } // install + build |
| 99 | - if (! $this->option('skip-db')) { |
|
| 99 | + if (!$this->option('skip-db')) { |
|
| 100 | 100 | $steps++; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | // Check if app is in maintenance mode |
| 116 | 116 | $this->wasInMaintenance = App::isDownForMaintenance(); |
| 117 | - if (! $this->wasInMaintenance) { |
|
| 117 | + if (!$this->wasInMaintenance) { |
|
| 118 | 118 | $this->call('down', [ |
| 119 | 119 | '--render' => 'errors::maintenance', |
| 120 | 120 | '--retry' => 120, |
@@ -138,22 +138,22 @@ discard block |
||
| 138 | 138 | private function executeUpdateSteps(): void |
| 139 | 139 | { |
| 140 | 140 | // Git operations |
| 141 | - if (! $this->option('skip-git')) { |
|
| 141 | + if (!$this->option('skip-git')) { |
|
| 142 | 142 | $this->performGitUpdate(); |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | // Composer operations |
| 146 | - if (! $this->option('skip-composer')) { |
|
| 146 | + if (!$this->option('skip-composer')) { |
|
| 147 | 147 | $this->performComposerUpdate(); |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | // Database migrations |
| 151 | - if (! $this->option('skip-db')) { |
|
| 151 | + if (!$this->option('skip-db')) { |
|
| 152 | 152 | $this->performDatabaseUpdate(); |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | // NPM operations |
| 156 | - if (! $this->option('skip-npm')) { |
|
| 156 | + if (!$this->option('skip-npm')) { |
|
| 157 | 157 | $this->performNpmOperations(); |
| 158 | 158 | } |
| 159 | 159 | |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | { |
| 217 | 217 | // Check if package.json has changed |
| 218 | 218 | $packageLockExists = File::exists(base_path('package-lock.json')); |
| 219 | - $shouldInstall = ! $packageLockExists || $this->option('force'); |
|
| 219 | + $shouldInstall = !$packageLockExists || $this->option('force'); |
|
| 220 | 220 | |
| 221 | 221 | if ($shouldInstall) { |
| 222 | 222 | $this->info(' |
@@ -55,7 +55,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 86 | 86 | $this->info(" |
@@ -64,7 +64,7 @@ |
||
| 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(" |
@@ -42,14 +42,14 @@ |
||
| 42 | 42 | $this->info(' |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | foreach ($chunks as $chunk) { |
| 121 | 121 | foreach ($chunk as $release) { |
| 122 | 122 | $searchname = $release->searchname ?? ''; |
| 123 | - $progressBar->setMessage("Processing: " . substr($searchname, 0, 50) . "..."); |
|
| 123 | + $progressBar->setMessage("Processing: ".substr($searchname, 0, 50)."..."); |
|
| 124 | 124 | |
| 125 | 125 | try { |
| 126 | 126 | // Extract clean title from searchname |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | // Check if we should skip (if not forcing and data exists) |
| 148 | 148 | // Don't skip if we're retrying failed releases (anidbid <= 0) |
| 149 | - if (! $force && ! $missingOnly && ! $retryFailed) { |
|
| 149 | + if (!$force && !$missingOnly && !$retryFailed) { |
|
| 150 | 150 | // Check if release already has complete AniList data |
| 151 | 151 | if ($release->anidbid > 0) { |
| 152 | 152 | $anidbInfo = DB::table('anidb_info') |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $this->enforceRateLimit(); |
| 170 | 170 | $searchResults = $populateAniList->searchAnime($cleanTitle, 1); |
| 171 | 171 | |
| 172 | - if (! $searchResults || empty($searchResults)) { |
|
| 172 | + if (!$searchResults || empty($searchResults)) { |
|
| 173 | 173 | // Try with spaces replaced for broader matching |
| 174 | 174 | $altTitle = preg_replace('/\s+/', ' ', $cleanTitle); |
| 175 | 175 | if ($altTitle !== $cleanTitle) { |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | - if (! $searchResults || empty($searchResults)) { |
|
| 181 | + if (!$searchResults || empty($searchResults)) { |
|
| 182 | 182 | $notFound++; |
| 183 | 183 | $failedSearchnames[] = [ |
| 184 | 184 | 'searchname' => $searchname, |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | $anilistData = $searchResults[0]; |
| 200 | 200 | $anilistId = $anilistData['id'] ?? null; |
| 201 | 201 | |
| 202 | - if (! $anilistId) { |
|
| 202 | + if (!$anilistId) { |
|
| 203 | 203 | $notFound++; |
| 204 | 204 | $failedSearchnames[] = [ |
| 205 | 205 | 'searchname' => $searchname, |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | ->where('anilist_id', $anilistId) |
| 228 | 228 | ->value('anidbid'); |
| 229 | 229 | |
| 230 | - if (! $anidbid) { |
|
| 230 | + if (!$anidbid) { |
|
| 231 | 231 | // Fallback: use anilist_id as anidbid |
| 232 | 232 | $anidbid = (int) $anilistId; |
| 233 | 233 | } |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | $this->line(" - {$item['searchname']} -> {$cleanedTitle} ({$item['reason']})"); |
| 272 | 272 | } |
| 273 | 273 | if (count($failedSearchnames) > 10) { |
| 274 | - $this->line(" ... and " . (count($failedSearchnames) - 10) . " more."); |
|
| 274 | + $this->line(" ... and ".(count($failedSearchnames) - 10)." more."); |
|
| 275 | 275 | } |
| 276 | 276 | } |
| 277 | 277 | |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | $failed++; |
| 282 | 282 | if ($this->getOutput()->isVerbose()) { |
| 283 | 283 | $this->newLine(); |
| 284 | - $this->error("Error processing release ID {$release->id}: " . $e->getMessage()); |
|
| 284 | + $this->error("Error processing release ID {$release->id}: ".$e->getMessage()); |
|
| 285 | 285 | } |
| 286 | 286 | } |
| 287 | 287 | |
@@ -319,8 +319,8 @@ discard block |
||
| 319 | 319 | foreach ($examples as $item) { |
| 320 | 320 | $cleanedTitle = $item['cleaned_title'] ?? '(extraction failed)'; |
| 321 | 321 | $rows[] = [ |
| 322 | - substr($item['searchname'], 0, 60) . (strlen($item['searchname']) > 60 ? '...' : ''), |
|
| 323 | - substr($cleanedTitle, 0, 40) . (strlen($cleanedTitle) > 40 ? '...' : ''), |
|
| 322 | + substr($item['searchname'], 0, 60).(strlen($item['searchname']) > 60 ? '...' : ''), |
|
| 323 | + substr($cleanedTitle, 0, 40).(strlen($cleanedTitle) > 40 ? '...' : ''), |
|
| 324 | 324 | $item['reason'], |
| 325 | 325 | ]; |
| 326 | 326 | } |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | ); |
| 332 | 332 | |
| 333 | 333 | if (count($failedSearchnames) > 20) { |
| 334 | - $this->line("... and " . (count($failedSearchnames) - 20) . " more. Use --verbose to see all."); |
|
| 334 | + $this->line("... and ".(count($failedSearchnames) - 20)." more. Use --verbose to see all."); |
|
| 335 | 335 | } |
| 336 | 336 | } |
| 337 | 337 | |
@@ -467,7 +467,7 @@ discard block |
||
| 467 | 467 | $now = time(); |
| 468 | 468 | |
| 469 | 469 | // Clean old timestamps (older than 1 minute) |
| 470 | - $this->requestTimestamps = array_filter($this->requestTimestamps, function ($timestamp) use ($now) { |
|
| 470 | + $this->requestTimestamps = array_filter($this->requestTimestamps, function($timestamp) use ($now) { |
|
| 471 | 471 | return ($now - $timestamp) < 60; |
| 472 | 472 | }); |
| 473 | 473 | |
@@ -476,20 +476,20 @@ discard block |
||
| 476 | 476 | // If we're at or over the limit, wait |
| 477 | 477 | if ($requestCount >= self::RATE_LIMIT_PER_MINUTE) { |
| 478 | 478 | // Calculate wait time based on oldest request |
| 479 | - if (! empty($this->requestTimestamps)) { |
|
| 479 | + if (!empty($this->requestTimestamps)) { |
|
| 480 | 480 | $oldestRequest = min($this->requestTimestamps); |
| 481 | 481 | $waitTime = 60 - ($now - $oldestRequest) + 1; // +1 for safety margin |
| 482 | 482 | |
| 483 | 483 | if ($waitTime > 0 && $waitTime <= 60) { |
| 484 | 484 | if ($this->getOutput()->isVerbose()) { |
| 485 | 485 | $this->newLine(); |
| 486 | - $this->warn("Rate limit reached ({$requestCount}/" . self::RATE_LIMIT_PER_MINUTE . "). Waiting {$waitTime} seconds..."); |
|
| 486 | + $this->warn("Rate limit reached ({$requestCount}/".self::RATE_LIMIT_PER_MINUTE."). Waiting {$waitTime} seconds..."); |
|
| 487 | 487 | } |
| 488 | 488 | sleep($waitTime); |
| 489 | 489 | |
| 490 | 490 | // Clean timestamps again after waiting |
| 491 | 491 | $now = time(); |
| 492 | - $this->requestTimestamps = array_filter($this->requestTimestamps, function ($timestamp) use ($now) { |
|
| 492 | + $this->requestTimestamps = array_filter($this->requestTimestamps, function($timestamp) use ($now) { |
|
| 493 | 493 | return ($now - $timestamp) < 60; |
| 494 | 494 | }); |
| 495 | 495 | } |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | $minDelay = 60.0 / self::RATE_LIMIT_PER_MINUTE; |
| 502 | 502 | |
| 503 | 503 | // If we have recent requests, ensure we wait at least the minimum delay |
| 504 | - if (! empty($this->requestTimestamps)) { |
|
| 504 | + if (!empty($this->requestTimestamps)) { |
|
| 505 | 505 | $lastRequest = max($this->requestTimestamps); |
| 506 | 506 | $timeSinceLastRequest = $now - $lastRequest; |
| 507 | 507 | |