@@ -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; |
@@ -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 |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | 'search' => ['available' => 'yes', 'supportedParams' => 'id'], |
53 | 53 | 'tv-search' => ['available' => 'yes', 'supportedParams' => 'id,vid,tvdbid,traktid,rid,tvmazeid,imdbid,tmdbid,season,ep'], |
54 | 54 | 'movie-search' => ['available' => 'yes', 'supportedParams' => 'id, imdbid, tmdbid, traktid'], |
55 | - 'audio-search' => ['available' => 'no', 'supportedParams' => ''], |
|
55 | + 'audio-search' => ['available' => 'no', 'supportedParams' => ''], |
|
56 | 56 | ], |
57 | 57 | 'categories' => fractal($category, new CategoryTransformer), |
58 | 58 | ]; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | ->with('role') // Eager load role to avoid N+1 |
76 | 76 | ->first(); |
77 | 77 | |
78 | - if (! $user) { |
|
78 | + if (!$user) { |
|
79 | 79 | return response()->json(['error' => 'Invalid API key'], 403); |
80 | 80 | } |
81 | 81 |
@@ -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; |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | $manticore->truncateRTIndex(Arr::wrap($indexName)); |
155 | 155 | |
156 | 156 | $total = Release::count(); |
157 | - if (! $total) { |
|
157 | + if (!$total) { |
|
158 | 158 | $this->warn('Releases table is empty. Nothing to do.'); |
159 | 159 | |
160 | 160 | return Command::SUCCESS; |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $indexName, |
184 | 184 | $total, |
185 | 185 | $query, |
186 | - function ($item) { |
|
186 | + function($item) { |
|
187 | 187 | return [ |
188 | 188 | 'id' => (string) $item->id, |
189 | 189 | 'name' => (string) ($item->name ?: ''), |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $manticore->truncateRTIndex([$indexName]); |
209 | 209 | |
210 | 210 | $total = Predb::count(); |
211 | - if (! $total) { |
|
211 | + if (!$total) { |
|
212 | 212 | $this->warn('PreDB table is empty. Nothing to do.'); |
213 | 213 | |
214 | 214 | return Command::SUCCESS; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $indexName, |
223 | 223 | $total, |
224 | 224 | $query, |
225 | - function ($item) { |
|
225 | + function($item) { |
|
226 | 226 | return [ |
227 | 227 | 'id' => $item->id, |
228 | 228 | 'title' => (string) ($item->title ?? ''), |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | $errorCount = 0; |
260 | 260 | |
261 | 261 | try { |
262 | - $query->chunk($chunkSize, function ($items) use ($manticore, $indexName, $transformer, $bar, &$processedCount, &$errorCount) { |
|
262 | + $query->chunk($chunkSize, function($items) use ($manticore, $indexName, $transformer, $bar, &$processedCount, &$errorCount) { |
|
263 | 263 | $data = []; |
264 | 264 | |
265 | 265 | foreach ($items as $item) { |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | $bar->advance(); |
276 | 276 | } |
277 | 277 | |
278 | - if (! empty($data)) { |
|
278 | + if (!empty($data)) { |
|
279 | 279 | $manticore->manticoreSearch->table($indexName)->replaceDocuments($data); |
280 | 280 | } |
281 | 281 | }); |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | private function elasticReleases(): int |
307 | 307 | { |
308 | 308 | $total = Release::count(); |
309 | - if (! $total) { |
|
309 | + if (!$total) { |
|
310 | 310 | $this->warn('Releases table is empty. Nothing to do.'); |
311 | 311 | |
312 | 312 | return Command::SUCCESS; |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | 'releases', |
338 | 338 | $total, |
339 | 339 | $query, |
340 | - function ($item) { |
|
340 | + function($item) { |
|
341 | 341 | $searchName = str_replace(['.', '-'], ' ', $item->searchname ?? ''); |
342 | 342 | |
343 | 343 | return [ |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | private function elasticPredb(): int |
361 | 361 | { |
362 | 362 | $total = Predb::count(); |
363 | - if (! $total) { |
|
363 | + if (!$total) { |
|
364 | 364 | $this->warn('PreDB table is empty. Nothing to do.'); |
365 | 365 | |
366 | 366 | return Command::SUCCESS; |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | 'predb', |
375 | 375 | $total, |
376 | 376 | $query, |
377 | - function ($item) { |
|
377 | + function($item) { |
|
378 | 378 | return [ |
379 | 379 | 'id' => $item->id, |
380 | 380 | 'title' => $item->title, |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | $batchSize = min($chunkSize, 1000); // ElasticSearch performs better with smaller bulk sizes |
411 | 411 | |
412 | 412 | try { |
413 | - $query->chunk($chunkSize, function ($items) use ($indexName, $transformer, $bar, &$processedCount, &$errorCount, $batchSize) { |
|
413 | + $query->chunk($chunkSize, function($items) use ($indexName, $transformer, $bar, &$processedCount, &$errorCount, $batchSize) { |
|
414 | 414 | // Process in smaller batches for ElasticSearch |
415 | 415 | foreach ($items->chunk($batchSize) as $batch) { |
416 | 416 | $data = ['body' => []]; |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | $bar->advance(); |
439 | 439 | } |
440 | 440 | |
441 | - if (! empty($data['body'])) { |
|
441 | + if (!empty($data['body'])) { |
|
442 | 442 | $response = \Elasticsearch::bulk($data); |
443 | 443 | |
444 | 444 | // Check for errors in bulk response |
@@ -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(' |
@@ -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(' |