Passed
Push — master ( 0ddaf0...97ef82 )
by Darko
07:24
created
app/Http/Controllers/Admin/AdminUserController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
         // Add country data to each user based on their host IP
58 58
         foreach ($results as $user) {
59 59
             $position = null;
60
-            if (! empty($user->host) && filter_var($user->host, FILTER_VALIDATE_IP)) {
60
+            if (!empty($user->host) && filter_var($user->host, FILTER_VALIDATE_IP)) {
61 61
                 $position = Location::get($user->host);
62 62
             }
63 63
             $user->country_name = $position ? $position->countryName : null;
Please login to merge, or discard this patch.
app/Http/Middleware/TrustedDevice2FAMiddleware.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -50,14 +50,14 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/LoginController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/Support/Google2FAAuthenticator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,12 +35,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
app/Console/Commands/UpdateNNTmuxComposer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
             return Command::SUCCESS;
59 59
 
60 60
         } catch (\Exception $e) {
61
-            $this->error('❌ Composer update failed: ' . $e->getMessage());
61
+            $this->error('❌ Composer update failed: '.$e->getMessage());
62 62
             return Command::FAILURE;
63 63
         }
64 64
     }
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
             ->run($command);
76 76
 
77 77
         if (!$process->successful()) {
78
-            throw new \Exception('Composer install failed: ' . $process->errorOutput());
78
+            throw new \Exception('Composer install failed: '.$process->errorOutput());
79 79
         }
80 80
 
81 81
         $this->line('  ✓ Dependencies installed successfully');
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
             ->run($command);
94 94
 
95 95
         if (!$process->successful()) {
96
-            throw new \Exception('Composer update failed: ' . $process->errorOutput());
96
+            throw new \Exception('Composer update failed: '.$process->errorOutput());
97 97
         }
98 98
 
99 99
         $this->line('  ✓ Dependencies updated successfully');
Please login to merge, or discard this patch.
app/Console/Commands/UpdateNNTmux.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         } catch (\Exception $e) {
75 75
             $this->progressBar->finish();
76 76
             $this->newLine(2);
77
-            $this->error('❌ Update failed: ' . $e->getMessage());
77
+            $this->error('❌ Update failed: '.$e->getMessage());
78 78
             $this->restoreEnvironment();
79 79
 
80 80
             return Command::FAILURE;
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
                     ->run('npm install --silent');
227 227
 
228 228
                 if (!$process->successful()) {
229
-                    throw new \Exception('NPM install failed: ' . $process->errorOutput());
229
+                    throw new \Exception('NPM install failed: '.$process->errorOutput());
230 230
                 }
231 231
             }
232 232
         }
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
             ->run('npm run build');
242 242
 
243 243
         if (!$buildProcess->successful()) {
244
-            throw new \Exception('Asset build failed: ' . $buildProcess->errorOutput());
244
+            throw new \Exception('Asset build failed: '.$buildProcess->errorOutput());
245 245
         }
246 246
 
247 247
         $this->progressBar->advance();
@@ -276,10 +276,10 @@  discard block
 block discarded – undo
276 276
                 $this->line('  ✓ Smarty compiled template cache cleared');
277 277
             } else {
278 278
                 $this->warn('  ⚠ Could not clear Smarty cache automatically');
279
-                $this->line('    Please clear manually: ' . config('ytake-laravel-smarty.compile_path'));
279
+                $this->line('    Please clear manually: '.config('ytake-laravel-smarty.compile_path'));
280 280
             }
281 281
         } catch (\Exception $e) {
282
-            $this->warn('  ⚠ Smarty cache clear failed: ' . $e->getMessage());
282
+            $this->warn('  ⚠ Smarty cache clear failed: '.$e->getMessage());
283 283
         }
284 284
     }
285 285
 
@@ -313,10 +313,10 @@  discard block
 block discarded – undo
313 313
             }
314 314
 
315 315
             $this->addMissingEnvVars($envPath, $missingKeys);
316
-            $this->line("  ✓ Merged " . count($missingKeys) . " new environment variables");
316
+            $this->line("  ✓ Merged ".count($missingKeys)." new environment variables");
317 317
 
318 318
         } catch (\Exception $e) {
319
-            $this->warn('  ⚠ Environment merge failed: ' . $e->getMessage());
319
+            $this->warn('  ⚠ Environment merge failed: '.$e->getMessage());
320 320
         }
321 321
     }
322 322
 
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
             $content .= "\n";
357 357
         }
358 358
 
359
-        $content .= "\n# New settings added from .env.example on " . now()->toDateTimeString() . "\n";
359
+        $content .= "\n# New settings added from .env.example on ".now()->toDateTimeString()."\n";
360 360
 
361 361
         foreach ($missingKeys as $key => $value) {
362 362
             $content .= "$key=$value\n";
Please login to merge, or discard this patch.
Braces   +13 added lines, -4 removed lines patch added patch discarded remove patch
@@ -88,10 +88,19 @@
 block discarded – undo
88 88
     {
89 89
         $steps = 3; // prepare, finalize, cleanup
90 90
 
91
-        if (!$this->option('skip-git')) $steps++;
92
-        if (!$this->option('skip-composer')) $steps++;
93
-        if (!$this->option('skip-npm')) $steps += 2; // install + build
94
-        if (!$this->option('skip-db')) $steps++;
91
+        if (!$this->option('skip-git')) {
92
+            $steps++;
93
+        }
94
+        if (!$this->option('skip-composer')) {
95
+            $steps++;
96
+        }
97
+        if (!$this->option('skip-npm')) {
98
+            $steps += 2;
99
+        }
100
+        // install + build
101
+        if (!$this->option('skip-db')) {
102
+            $steps++;
103
+        }
95 104
 
96 105
         $steps++; // smarty cache clear
97 106
         $steps++; // env merge
Please login to merge, or discard this patch.
app/Console/Commands/TmuxUIStart.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
             return Command::SUCCESS;
66 66
 
67 67
         } catch (\Exception $e) {
68
-            $this->error('❌ Failed to start Tmux UI: ' . $e->getMessage());
68
+            $this->error('❌ Failed to start Tmux UI: '.$e->getMessage());
69 69
             return Command::FAILURE;
70 70
         }
71 71
     }
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
             $process = Process::timeout($timeout)->tty()->run($command);
124 124
 
125 125
             if (!$process->successful()) {
126
-                throw new \Exception('Tmux session failed to start: ' . $process->errorOutput());
126
+                throw new \Exception('Tmux session failed to start: '.$process->errorOutput());
127 127
             }
128 128
         } else {
129 129
             // Start in background
Please login to merge, or discard this patch.
app/Console/Commands/UpdateNNTmuxGit.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             return Command::SUCCESS;
77 77
 
78 78
         } catch (\Exception $e) {
79
-            $this->error('❌ Git update failed: ' . $e->getMessage());
79
+            $this->error('❌ Git update failed: '.$e->getMessage());
80 80
             return Command::FAILURE;
81 81
         }
82 82
     }
@@ -103,10 +103,10 @@  discard block
 block discarded – undo
103 103
      */
104 104
     private function stashChanges(): void
105 105
     {
106
-        $process = Process::run('git stash push -m "Auto-stash before update on ' . now()->toDateTimeString() . '"');
106
+        $process = Process::run('git stash push -m "Auto-stash before update on '.now()->toDateTimeString().'"');
107 107
 
108 108
         if (!$process->successful()) {
109
-            throw new \Exception('Failed to stash changes: ' . $process->errorOutput());
109
+            throw new \Exception('Failed to stash changes: '.$process->errorOutput());
110 110
         }
111 111
 
112 112
         $this->line('  ✓ Changes stashed successfully');
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
         $process = Process::run('git branch --show-current');
121 121
 
122 122
         if (!$process->successful()) {
123
-            throw new \Exception('Failed to get current branch: ' . $process->errorOutput());
123
+            throw new \Exception('Failed to get current branch: '.$process->errorOutput());
124 124
         }
125 125
 
126 126
         return trim($process->output());
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         $process = Process::timeout(300)->run('git fetch --prune');
135 135
 
136 136
         if (!$process->successful()) {
137
-            throw new \Exception('Failed to fetch changes: ' . $process->errorOutput());
137
+            throw new \Exception('Failed to fetch changes: '.$process->errorOutput());
138 138
         }
139 139
     }
140 140
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         $process = Process::timeout(300)->run($pullCommand);
166 166
 
167 167
         if (!$process->successful()) {
168
-            throw new \Exception('Failed to pull changes: ' . $process->errorOutput());
168
+            throw new \Exception('Failed to pull changes: '.$process->errorOutput());
169 169
         }
170 170
 
171 171
         $this->line('  ✓ Changes pulled successfully');
Please login to merge, or discard this patch.
app/Console/Commands/UpdateNNTmuxDB.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             return Command::SUCCESS;
71 71
 
72 72
         } catch (\Exception $e) {
73
-            $this->error('❌ Database update failed: ' . $e->getMessage());
73
+            $this->error('❌ Database update failed: '.$e->getMessage());
74 74
             return Command::FAILURE;
75 75
         }
76 76
     }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         try {
84 84
             DB::connection()->getPdo();
85 85
 
86
-            $dbConfig = config('database.connections.' . config('database.default'));
86
+            $dbConfig = config('database.connections.'.config('database.default'));
87 87
             $driver = $dbConfig['driver'] ?? null;
88 88
 
89 89
             // Detect actual database type for MySQL-compatible drivers
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             return $driver;
105 105
 
106 106
         } catch (\Exception $e) {
107
-            $this->error('  ✗ Database connection failed: ' . $e->getMessage());
107
+            $this->error('  ✗ Database connection failed: '.$e->getMessage());
108 108
             return null;
109 109
         }
110 110
     }
@@ -160,9 +160,9 @@  discard block
 block discarded – undo
160 160
 
161 161
             $timestamp = now()->format('Y-m-d_H-i-s');
162 162
             $filename = "nntmux_backup_{$timestamp}.sql";
163
-            $fullPath = $backupPath . '/' . $filename;
163
+            $fullPath = $backupPath.'/'.$filename;
164 164
 
165
-            $dbConfig = config('database.connections.' . config('database.default'));
165
+            $dbConfig = config('database.connections.'.config('database.default'));
166 166
 
167 167
             if (in_array($dbType, ['mysql', 'mariadb'])) {
168 168
                 $this->createMysqlCompatibleBackup($dbConfig, $fullPath, $dbType);
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
             }
174 174
 
175 175
         } catch (\Exception $e) {
176
-            $this->warn('  ⚠ Backup creation failed: ' . $e->getMessage());
176
+            $this->warn('  ⚠ Backup creation failed: '.$e->getMessage());
177 177
         }
178 178
     }
179 179
 
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
             escapeshellarg($dbConfig['host']),
189 189
             escapeshellarg($dbConfig['port']),
190 190
             escapeshellarg($dbConfig['username']),
191
-            !empty($dbConfig['password']) ? '-p' . escapeshellarg($dbConfig['password']) : '',
191
+            !empty($dbConfig['password']) ? '-p'.escapeshellarg($dbConfig['password']) : '',
192 192
             escapeshellarg($dbConfig['database']),
193 193
             escapeshellarg($fullPath)
194 194
         );
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
         exec($command, $output, $returnVar);
197 197
 
198 198
         if ($returnVar === 0 && file_exists($fullPath) && filesize($fullPath) > 0) {
199
-            $this->line("  ✓ $dbType backup created: " . basename($fullPath));
199
+            $this->line("  ✓ $dbType backup created: ".basename($fullPath));
200 200
         } else {
201 201
             // Fallback to mysqldump if mariadb-dump failed
202 202
             if ($dbType === 'mariadb') {
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
                 exec($fallbackCommand, $output, $returnVar);
205 205
 
206 206
                 if ($returnVar === 0 && file_exists($fullPath) && filesize($fullPath) > 0) {
207
-                    $this->line("  ✓ MySQL backup created (fallback): " . basename($fullPath));
207
+                    $this->line("  ✓ MySQL backup created (fallback): ".basename($fullPath));
208 208
                 } else {
209 209
                     $this->warn('  ⚠ Backup creation failed');
210 210
                 }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
         exec($command, $output, $returnVar);
233 233
 
234 234
         if ($returnVar === 0 && file_exists($fullPath) && filesize($fullPath) > 0) {
235
-            $this->line("  ✓ PostgreSQL backup created: " . basename($fullPath));
235
+            $this->line("  ✓ PostgreSQL backup created: ".basename($fullPath));
236 236
         } else {
237 237
             $this->warn('  ⚠ PostgreSQL backup creation failed');
238 238
         }
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
                 $this->line("  ℹ Database optimization skipped (unsupported type: $dbType)");
293 293
             }
294 294
         } catch (\Exception $e) {
295
-            $this->warn('  ⚠ Database optimization failed: ' . $e->getMessage());
295
+            $this->warn('  ⚠ Database optimization failed: '.$e->getMessage());
296 296
         }
297 297
     }
298 298
 
@@ -301,9 +301,9 @@  discard block
 block discarded – undo
301 301
      */
302 302
     private function optimizeMysqlCompatible(string $dbType): void
303 303
     {
304
-        $dbConfig = config('database.connections.' . config('database.default'));
304
+        $dbConfig = config('database.connections.'.config('database.default'));
305 305
         $tables = DB::select('SHOW TABLES');
306
-        $tableKey = 'Tables_in_' . $dbConfig['database'];
306
+        $tableKey = 'Tables_in_'.$dbConfig['database'];
307 307
 
308 308
         $optimizedCount = 0;
309 309
         foreach ($tables as $table) {
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
             }
317 317
         }
318 318
 
319
-        $this->line("  ✓ $dbType tables optimized ($optimizedCount/" . count($tables) . ")");
319
+        $this->line("  ✓ $dbType tables optimized ($optimizedCount/".count($tables).")");
320 320
     }
321 321
 
322 322
     /**
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
             DB::statement('VACUUM ANALYZE');
329 329
             $this->line('  ✓ PostgreSQL database optimized (VACUUM ANALYZE)');
330 330
         } catch (\Exception $e) {
331
-            $this->warn('  ⚠ PostgreSQL optimization failed: ' . $e->getMessage());
331
+            $this->warn('  ⚠ PostgreSQL optimization failed: '.$e->getMessage());
332 332
         }
333 333
     }
334 334
 }
Please login to merge, or discard this patch.