@@ -50,14 +50,14 @@ |
||
| 50 | 50 | try { |
| 51 | 51 | // Create a cookie instance with proper settings for persistence |
| 52 | 52 | $cookie = cookie( |
| 53 | - '2fa_trusted_device', // name |
|
| 54 | - $cookieValue, // value |
|
| 55 | - 60 * 24 * 30, // minutes (30 days) |
|
| 56 | - '/', // path |
|
| 57 | - null, // domain (null = current domain) |
|
| 58 | - null, // secure (auto) |
|
| 59 | - false, // httpOnly - allow JS access |
|
| 60 | - false, // raw |
|
| 53 | + '2fa_trusted_device', // name |
|
| 54 | + $cookieValue, // value |
|
| 55 | + 60 * 24 * 30, // minutes (30 days) |
|
| 56 | + '/', // path |
|
| 57 | + null, // domain (null = current domain) |
|
| 58 | + null, // secure (auto) |
|
| 59 | + false, // httpOnly - allow JS access |
|
| 60 | + false, // raw |
|
| 61 | 61 | 'lax' // sameSite |
| 62 | 62 | ); |
| 63 | 63 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | |
| 85 | 85 | $rememberMe = $request->has('rememberme') && $request->input('rememberme') === 'on'; |
| 86 | 86 | |
| 87 | - if (! $user->isVerified() || $user->isPendingVerification()) { |
|
| 87 | + if (!$user->isVerified() || $user->isPendingVerification()) { |
|
| 88 | 88 | $request->session()->flash('message', 'You have not verified your email address!'); |
| 89 | 89 | |
| 90 | 90 | return redirect()->to('login'); |
@@ -204,14 +204,14 @@ discard block |
||
| 204 | 204 | if ($remainingMinutes > 0) { |
| 205 | 205 | // Create a cookie with proper settings for persistence |
| 206 | 206 | $cookie = cookie( |
| 207 | - '2fa_trusted_device', // name |
|
| 208 | - $trustedDeviceCookie, // value |
|
| 209 | - $remainingMinutes, // minutes remaining |
|
| 210 | - '/', // path |
|
| 207 | + '2fa_trusted_device', // name |
|
| 208 | + $trustedDeviceCookie, // value |
|
| 209 | + $remainingMinutes, // minutes remaining |
|
| 210 | + '/', // path |
|
| 211 | 211 | config('session.domain'), // use session domain config |
| 212 | 212 | config('session.secure'), // use session secure config |
| 213 | - false, // httpOnly |
|
| 214 | - false, // raw |
|
| 213 | + false, // httpOnly |
|
| 214 | + false, // raw |
|
| 215 | 215 | config('session.same_site', 'lax') // use session same_site config |
| 216 | 216 | ); |
| 217 | 217 | |
@@ -35,12 +35,12 @@ discard block |
||
| 35 | 35 | try { |
| 36 | 36 | $data = @json_decode($cookie, true); |
| 37 | 37 | |
| 38 | - if (! is_array($data)) { |
|
| 38 | + if (!is_array($data)) { |
|
| 39 | 39 | return false; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | // Validate all required fields |
| 43 | - if (! isset($data['user_id'], $data['token'], $data['expires_at'])) { |
|
| 43 | + if (!isset($data['user_id'], $data['token'], $data['expires_at'])) { |
|
| 44 | 44 | return false; |
| 45 | 45 | } |
| 46 | 46 | |
@@ -63,13 +63,13 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | protected function canPassWithoutCheckingOTP(): bool |
| 65 | 65 | { |
| 66 | - if (! $this->getUser()->passwordSecurity) { |
|
| 66 | + if (!$this->getUser()->passwordSecurity) { |
|
| 67 | 67 | return true; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | return |
| 71 | - ! $this->getUser()->passwordSecurity->google2fa_enable || |
|
| 72 | - ! $this->isEnabled() || |
|
| 71 | + !$this->getUser()->passwordSecurity->google2fa_enable || |
|
| 72 | + !$this->isEnabled() || |
|
| 73 | 73 | $this->noUserIsAuthenticated() || |
| 74 | 74 | $this->twoFactorAuthStillValid() || |
| 75 | 75 | $this->isDeviceTrusted(); |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $cookie = request()->cookie('2fa_trusted_device'); |
| 85 | 85 | $user = $this->getUser(); |
| 86 | 86 | |
| 87 | - if (! $cookie) { |
|
| 87 | + if (!$cookie) { |
|
| 88 | 88 | return false; |
| 89 | 89 | } |
| 90 | 90 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | // Validate the required fields silently |
| 99 | - if (! isset($data['user_id'], $data['token'], $data['expires_at'])) { |
|
| 99 | + if (!isset($data['user_id'], $data['token'], $data['expires_at'])) { |
|
| 100 | 100 | return false; |
| 101 | 101 | } |
| 102 | 102 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | // Check database connection and detect database type |
| 32 | 32 | $dbType = $this->checkDatabaseConnection(); |
| 33 | - if (! $dbType) { |
|
| 33 | + if (!$dbType) { |
|
| 34 | 34 | $this->error('Database connection failed'); |
| 35 | 35 | |
| 36 | 36 | return Command::FAILURE; |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | $this->warn("⚠️ Rolling back $steps migrations..."); |
| 125 | 125 | |
| 126 | - if (! $this->confirm('Are you sure you want to rollback migrations? This may cause data loss.')) { |
|
| 126 | + if (!$this->confirm('Are you sure you want to rollback migrations? This may cause data loss.')) { |
|
| 127 | 127 | $this->info('Rollback cancelled'); |
| 128 | 128 | |
| 129 | 129 | return Command::SUCCESS; |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | $engine = $this->getSelectedEngine(); |
| 54 | 54 | $index = $this->getSelectedIndex(); |
| 55 | 55 | |
| 56 | - if (! $engine || ! $index) { |
|
| 56 | + if (!$engine || !$index) { |
|
| 57 | 57 | $this->error('You must specify both an engine (--manticore or --elastic) and an index (--releases or --predb).'); |
| 58 | 58 | $this->info('Use --help to see all available options.'); |
| 59 | 59 | |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | { |
| 128 | 128 | $methodName = "{$engine}".ucfirst($index); |
| 129 | 129 | |
| 130 | - if (! method_exists($this, $methodName)) { |
|
| 130 | + if (!method_exists($this, $methodName)) { |
|
| 131 | 131 | $this->error("Method {$methodName} not implemented."); |
| 132 | 132 | |
| 133 | 133 | return Command::FAILURE; |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | $manticore->truncateRTIndex(Arr::wrap($indexName)); |
| 158 | 158 | |
| 159 | 159 | $total = Release::count(); |
| 160 | - if (! $total) { |
|
| 160 | + if (!$total) { |
|
| 161 | 161 | $this->warn('Releases table is empty. Nothing to do.'); |
| 162 | 162 | |
| 163 | 163 | return Command::SUCCESS; |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | $indexName, |
| 187 | 187 | $total, |
| 188 | 188 | $query, |
| 189 | - function ($item) { |
|
| 189 | + function($item) { |
|
| 190 | 190 | return [ |
| 191 | 191 | 'id' => $item->id, |
| 192 | 192 | 'name' => (string) ($item->name ?? ''), |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | $manticore->truncateRTIndex([$indexName]); |
| 212 | 212 | |
| 213 | 213 | $total = Predb::count(); |
| 214 | - if (! $total) { |
|
| 214 | + if (!$total) { |
|
| 215 | 215 | $this->warn('PreDB table is empty. Nothing to do.'); |
| 216 | 216 | |
| 217 | 217 | return Command::SUCCESS; |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | $indexName, |
| 226 | 226 | $total, |
| 227 | 227 | $query, |
| 228 | - function ($item) { |
|
| 228 | + function($item) { |
|
| 229 | 229 | return [ |
| 230 | 230 | 'id' => $item->id, |
| 231 | 231 | 'title' => (string) ($item->title ?? ''), |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | $errorCount = 0; |
| 263 | 263 | |
| 264 | 264 | try { |
| 265 | - $query->chunk($chunkSize, function ($items) use ($manticore, $indexName, $transformer, $bar, &$processedCount, &$errorCount) { |
|
| 265 | + $query->chunk($chunkSize, function($items) use ($manticore, $indexName, $transformer, $bar, &$processedCount, &$errorCount) { |
|
| 266 | 266 | $data = []; |
| 267 | 267 | |
| 268 | 268 | foreach ($items as $item) { |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | $bar->advance(); |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | - if (! empty($data)) { |
|
| 281 | + if (!empty($data)) { |
|
| 282 | 282 | $manticore->manticoreSearch->table($indexName)->replaceDocuments($data); |
| 283 | 283 | } |
| 284 | 284 | }); |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | private function elasticReleases(): int |
| 310 | 310 | { |
| 311 | 311 | $total = Release::count(); |
| 312 | - if (! $total) { |
|
| 312 | + if (!$total) { |
|
| 313 | 313 | $this->warn('Releases table is empty. Nothing to do.'); |
| 314 | 314 | |
| 315 | 315 | return Command::SUCCESS; |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | 'releases', |
| 341 | 341 | $total, |
| 342 | 342 | $query, |
| 343 | - function ($item) { |
|
| 343 | + function($item) { |
|
| 344 | 344 | $searchName = str_replace(['.', '-'], ' ', $item->searchname ?? ''); |
| 345 | 345 | |
| 346 | 346 | return [ |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | private function elasticPredb(): int |
| 364 | 364 | { |
| 365 | 365 | $total = Predb::count(); |
| 366 | - if (! $total) { |
|
| 366 | + if (!$total) { |
|
| 367 | 367 | $this->warn('PreDB table is empty. Nothing to do.'); |
| 368 | 368 | |
| 369 | 369 | return Command::SUCCESS; |
@@ -377,7 +377,7 @@ discard block |
||
| 377 | 377 | 'predb', |
| 378 | 378 | $total, |
| 379 | 379 | $query, |
| 380 | - function ($item) { |
|
| 380 | + function($item) { |
|
| 381 | 381 | return [ |
| 382 | 382 | 'id' => $item->id, |
| 383 | 383 | 'title' => $item->title, |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | $batchSize = min($chunkSize, 1000); // ElasticSearch performs better with smaller bulk sizes |
| 414 | 414 | |
| 415 | 415 | try { |
| 416 | - $query->chunk($chunkSize, function ($items) use ($indexName, $transformer, $bar, &$processedCount, &$errorCount, $batchSize) { |
|
| 416 | + $query->chunk($chunkSize, function($items) use ($indexName, $transformer, $bar, &$processedCount, &$errorCount, $batchSize) { |
|
| 417 | 417 | // Process in smaller batches for ElasticSearch |
| 418 | 418 | foreach ($items->chunk($batchSize) as $batch) { |
| 419 | 419 | $data = ['body' => []]; |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | $bar->advance(); |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | - if (! empty($data['body'])) { |
|
| 444 | + if (!empty($data['body'])) { |
|
| 445 | 445 | $response = \Elasticsearch::bulk($data); |
| 446 | 446 | |
| 447 | 447 | // Check for errors in bulk response |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | */ |
| 14 | 14 | public static function hasFileChanged(string $filePath, ?string $cacheKey = null): bool |
| 15 | 15 | { |
| 16 | - if (! File::exists($filePath)) { |
|
| 16 | + if (!File::exists($filePath)) { |
|
| 17 | 17 | return false; |
| 18 | 18 | } |
| 19 | 19 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | // Check PHP extensions |
| 145 | 145 | $requiredExtensions = ['pdo', 'mbstring', 'openssl', 'json', 'curl']; |
| 146 | 146 | foreach ($requiredExtensions as $ext) { |
| 147 | - if (! extension_loaded($ext)) { |
|
| 147 | + if (!extension_loaded($ext)) { |
|
| 148 | 148 | $recommendations[] = "Missing PHP extension: $ext"; |
| 149 | 149 | } |
| 150 | 150 | } |
@@ -162,14 +162,14 @@ discard block |
||
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | $memInfo = @file_get_contents('/proc/meminfo'); |
| 165 | - if (! $memInfo) { |
|
| 165 | + if (!$memInfo) { |
|
| 166 | 166 | return null; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | preg_match('/MemTotal:\s+(\d+)/', $memInfo, $totalMatch); |
| 170 | 170 | preg_match('/MemAvailable:\s+(\d+)/', $memInfo, $availableMatch); |
| 171 | 171 | |
| 172 | - if (! isset($totalMatch[1]) || ! isset($availableMatch[1])) { |
|
| 172 | + if (!isset($totalMatch[1]) || !isset($availableMatch[1])) { |
|
| 173 | 173 | return null; |
| 174 | 174 | } |
| 175 | 175 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $this->info(' |
@@ -88,16 +88,16 @@ discard block |
||
| 88 | 88 | { |
| 89 | 89 | $steps = 3; // prepare, finalize, cleanup |
| 90 | 90 | |
| 91 | - if (! $this->option('skip-git')) { |
|
| 91 | + if (!$this->option('skip-git')) { |
|
| 92 | 92 | $steps++; |
| 93 | 93 | } |
| 94 | - if (! $this->option('skip-composer')) { |
|
| 94 | + if (!$this->option('skip-composer')) { |
|
| 95 | 95 | $steps++; |
| 96 | 96 | } |
| 97 | - if (! $this->option('skip-npm')) { |
|
| 97 | + if (!$this->option('skip-npm')) { |
|
| 98 | 98 | $steps += 2; |
| 99 | 99 | } // install + build |
| 100 | - if (! $this->option('skip-db')) { |
|
| 100 | + if (!$this->option('skip-db')) { |
|
| 101 | 101 | $steps++; |
| 102 | 102 | } |
| 103 | 103 | |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | // Check if app is in maintenance mode |
| 118 | 118 | $this->wasInMaintenance = App::isDownForMaintenance(); |
| 119 | - if (! $this->wasInMaintenance) { |
|
| 119 | + if (!$this->wasInMaintenance) { |
|
| 120 | 120 | $this->call('down', [ |
| 121 | 121 | '--render' => 'errors::maintenance', |
| 122 | 122 | '--retry' => 120, |
@@ -140,22 +140,22 @@ discard block |
||
| 140 | 140 | private function executeUpdateSteps(): void |
| 141 | 141 | { |
| 142 | 142 | // Git operations |
| 143 | - if (! $this->option('skip-git')) { |
|
| 143 | + if (!$this->option('skip-git')) { |
|
| 144 | 144 | $this->performGitUpdate(); |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | // Composer operations |
| 148 | - if (! $this->option('skip-composer')) { |
|
| 148 | + if (!$this->option('skip-composer')) { |
|
| 149 | 149 | $this->performComposerUpdate(); |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | // Database migrations |
| 153 | - if (! $this->option('skip-db')) { |
|
| 153 | + if (!$this->option('skip-db')) { |
|
| 154 | 154 | $this->performDatabaseUpdate(); |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | // NPM operations |
| 158 | - if (! $this->option('skip-npm')) { |
|
| 158 | + if (!$this->option('skip-npm')) { |
|
| 159 | 159 | $this->performNpmOperations(); |
| 160 | 160 | } |
| 161 | 161 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | { |
| 219 | 219 | // Check if package.json has changed |
| 220 | 220 | $packageLockExists = File::exists(base_path('package-lock.json')); |
| 221 | - $shouldInstall = ! $packageLockExists || $this->option('force'); |
|
| 221 | + $shouldInstall = !$packageLockExists || $this->option('force'); |
|
| 222 | 222 | |
| 223 | 223 | if ($shouldInstall) { |
| 224 | 224 | $this->info(' |
@@ -43,10 +43,10 @@ discard block |
||
| 43 | 43 | $this->checkSystemResources(); |
| 44 | 44 | |
| 45 | 45 | // Check if session already exists |
| 46 | - if (! $this->option('force') && $this->isSessionRunning($tmuxSession)) { |
|
| 46 | + if (!$this->option('force') && $this->isSessionRunning($tmuxSession)) { |
|
| 47 | 47 | $this->error("❌ Tmux session '$tmuxSession' is already running"); |
| 48 | 48 | |
| 49 | - if (! $this->confirm('Would you like to restart the session?')) { |
|
| 49 | + if (!$this->confirm('Would you like to restart the session?')) { |
|
| 50 | 50 | return Command::FAILURE; |
| 51 | 51 | } |
| 52 | 52 | |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | { |
| 80 | 80 | $recommendations = UpdatePerformanceHelper::checkSystemResources(); |
| 81 | 81 | |
| 82 | - if (! empty($recommendations)) { |
|
| 82 | + if (!empty($recommendations)) { |
|
| 83 | 83 | $this->warn('⚠️ System resource information:'); |
| 84 | 84 | foreach ($recommendations as $recommendation) { |
| 85 | 85 | $this->line(" • $recommendation"); |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | $runScript = base_path('misc/update/tmux/run.php'); |
| 109 | 109 | |
| 110 | - if (! file_exists($runScript)) { |
|
| 110 | + if (!file_exists($runScript)) { |
|
| 111 | 111 | throw new \Exception("Tmux run script not found: $runScript"); |
| 112 | 112 | } |
| 113 | 113 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | $this->info(' |