Passed
Push — master ( 1576de...c82cf0 )
by Darko
10:46
created
app/Models/User.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
     {
259 259
         $res = self::query()->withTrashed()->where('email', '<>', '[email protected]');
260 260
 
261
-        if (! empty($role)) {
261
+        if (!empty($role)) {
262 262
             $res->where('roles_id', $role);
263 263
         }
264 264
 
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
             'rate_limit' => $rateLimit ? $rateLimit['rate_limit'] : 60,
300 300
         ];
301 301
 
302
-        if (! empty($email)) {
302
+        if (!empty($email)) {
303 303
             $email = trim($email);
304 304
             $sql += ['email' => $email];
305 305
         }
@@ -348,10 +348,10 @@  discard block
 block discarded – undo
348 348
     {
349 349
         $user = self::find($uid);
350 350
         $currRoleExp = $user->rolechangedate ?? now()->toDateTimeString();
351
-        if (! empty($date)) {
351
+        if (!empty($date)) {
352 352
             $user->update(['rolechangedate' => $date]);
353 353
         }
354
-        if (empty($date) && ! empty($addYear)) {
354
+        if (empty($date) && !empty($addYear)) {
355 355
             $user->update(['rolechangedate' => Carbon::createFromDate($currRoleExp)->addYears($addYear)]);
356 356
         }
357 357
     }
@@ -408,10 +408,10 @@  discard block
 block discarded – undo
408 408
         return self::fromQuery(
409 409
             sprintf(
410 410
                 $query,
411
-                ! empty($userName) ? 'AND users.username '.'LIKE '.escapeString('%'.$userName.'%') : '',
412
-                ! empty($email) ? 'AND users.email '.'LIKE '.escapeString('%'.$email.'%') : '',
413
-                ! empty($host) ? 'AND users.host '.'LIKE '.escapeString('%'.$host.'%') : '',
414
-                (! empty($role) ? ('AND users.roles_id = '.$role) : ''),
411
+                !empty($userName) ? 'AND users.username '.'LIKE '.escapeString('%'.$userName.'%') : '',
412
+                !empty($email) ? 'AND users.email '.'LIKE '.escapeString('%'.$email.'%') : '',
413
+                !empty($host) ? 'AND users.host '.'LIKE '.escapeString('%'.$host.'%') : '',
414
+                (!empty($role) ? ('AND users.roles_id = '.$role) : ''),
415 415
                 $order[0],
416 416
                 $order[1],
417 417
                 ($start === false ? '' : ('LIMIT '.$offset.' OFFSET '.$start))
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
 
524 524
     public static function isValidUrl($url): bool
525 525
     {
526
-        return (! preg_match('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i', $url)) ? false : true;
526
+        return (!preg_match('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i', $url)) ? false : true;
527 527
     }
528 528
 
529 529
     /**
@@ -559,7 +559,7 @@  discard block
 block discarded – undo
559 559
 
560 560
         // Make sure this is the last check, as if a further validation check failed, the invite would still have been used up.
561 561
         $invitedBy = 0;
562
-        if (! $forceInviteMode && (int) Settings::settingValue('registerstatus') === Settings::REGISTER_STATUS_INVITE) {
562
+        if (!$forceInviteMode && (int) Settings::settingValue('registerstatus') === Settings::REGISTER_STATUS_INVITE) {
563 563
             if ($inviteCode === '') {
564 564
                 return self::ERR_SIGNUP_BADINVITECODE;
565 565
             }
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
     public static function checkAndUseInvite(string $inviteCode): int
580 580
     {
581 581
         $invite = Invitation::findValidByToken($inviteCode);
582
-        if (! $invite) {
582
+        if (!$invite) {
583 583
             return -1;
584 584
         }
585 585
 
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
     public static function add(string $userName, string $password, string $email, int $role, ?string $notes = '', string $host = '', int $invites = Invitation::DEFAULT_INVITES, int $invitedBy = 0)
596 596
     {
597 597
         $password = self::hashPassword($password);
598
-        if (! $password) {
598
+        if (!$password) {
599 599
             return false;
600 600
         }
601 601
 
@@ -637,9 +637,9 @@  discard block
 block discarded – undo
637 637
 
638 638
         $cats = ['view console', 'view movies', 'view audio', 'view tv', 'view pc', 'view adult', 'view books', 'view other'];
639 639
 
640
-        if (! empty($allowed)) {
640
+        if (!empty($allowed)) {
641 641
             foreach ($cats as $cat) {
642
-                if (! \in_array($cat, $allowed, false)) {
642
+                if (!\in_array($cat, $allowed, false)) {
643 643
                     $ret[] = match ($cat) {
644 644
                         'view console' => 1000,
645 645
                         'view movies' => 2000,
Please login to merge, or discard this patch.
app/Console/Commands/TmuxUIStart.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -43,10 +43,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
122 122
             $this->info('
Please login to merge, or discard this patch.
app/Console/Commands/UpdateNNTmuxComposer.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
             $this->info('
Please login to merge, or discard this patch.
app/Console/Commands/UpdateNNTmux.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -87,16 +87,16 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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('
Please login to merge, or discard this patch.
app/Console/Commands/UpdateNNTmuxGit.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -42,14 +42,14 @@
 block discarded – undo
42 42
             $this->info('
Please login to merge, or discard this patch.