@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $limit = $this->argument('limit'); |
| 35 | 35 | |
| 36 | 36 | // Validate the limit argument |
| 37 | - if ($limit !== 'full' && ! is_numeric($limit)) { |
|
| 37 | + if ($limit !== 'full' && !is_numeric($limit)) { |
|
| 38 | 38 | $this->error('Limit must be "full" or a numeric value.'); |
| 39 | 39 | |
| 40 | 40 | return 1; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | // Create each index |
| 97 | 97 | foreach ($indexes as $indexName => $schema) { |
| 98 | - if (! $this->createIndex($indexName, $schema, $dropExisting)) { |
|
| 98 | + if (!$this->createIndex($indexName, $schema, $dropExisting)) { |
|
| 99 | 99 | $hasErrors = true; |
| 100 | 100 | } |
| 101 | 101 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $indices->drop(['index' => $indexName, 'body' => ['silent' => true]]); |
| 128 | 128 | $this->info("Successfully dropped {$indexName} index."); |
| 129 | 129 | } catch (ResponseException $e) { |
| 130 | - if (! str_contains($e->getMessage(), 'unknown index')) { |
|
| 130 | + if (!str_contains($e->getMessage(), 'unknown index')) { |
|
| 131 | 131 | $this->warn("Warning when dropping {$indexName} index: ".$e->getMessage()); |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | ]); |
| 30 | 30 | |
| 31 | 31 | // Check if password is correct |
| 32 | - if (! Hash::check($validated['current_password'], Auth::user()->password)) { |
|
| 32 | + if (!Hash::check($validated['current_password'], Auth::user()->password)) { |
|
| 33 | 33 | if ($request->expectsJson() || $request->ajax()) { |
| 34 | 34 | return response()->json([ |
| 35 | 35 | 'success' => false, |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | User::onlyTrashed() |
| 35 | 35 | ->where('deleted_at', '<', now()->subDays(config('nntmux.purge_inactive_users_days'))) |
| 36 | 36 | ->get() |
| 37 | - ->each(function ($user) { |
|
| 37 | + ->each(function($user) { |
|
| 38 | 38 | $user->forceDelete(); // Permanently delete the user |
| 39 | 39 | }); |
| 40 | 40 | } |
@@ -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 | |
@@ -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 | |