Passed
Push — master ( 377492...fd7aee )
by Darko
10:20
created
app/Console/Commands/CaptchaStatus.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
         $recaptchaSecret = config('captcha.recaptcha.secret');
41 41
 
42 42
         $this->line('  Enabled: '.($recaptchaEnabled ? '<fg=green>Yes</>' : '<fg=red>No</>'));
43
-        $this->line('  Site Key: '.(! empty($recaptchaSitekey) ? '<fg=green>Configured</>' : '<fg=red>Missing</>'));
44
-        $this->line('  Secret: '.(! empty($recaptchaSecret) ? '<fg=green>Configured</>' : '<fg=red>Missing</>'));
43
+        $this->line('  Site Key: '.(!empty($recaptchaSitekey) ? '<fg=green>Configured</>' : '<fg=red>Missing</>'));
44
+        $this->line('  Secret: '.(!empty($recaptchaSecret) ? '<fg=green>Configured</>' : '<fg=red>Missing</>'));
45 45
         $this->newLine();
46 46
 
47 47
         // Check Turnstile
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
         $turnstileSecret = config('captcha.turnstile.secret');
52 52
 
53 53
         $this->line('  Enabled: '.($turnstileEnabled ? '<fg=green>Yes</>' : '<fg=red>No</>'));
54
-        $this->line('  Site Key: '.(! empty($turnstileSitekey) ? '<fg=green>Configured</>' : '<fg=red>Missing</>'));
55
-        $this->line('  Secret: '.(! empty($turnstileSecret) ? '<fg=green>Configured</>' : '<fg=red>Missing</>'));
54
+        $this->line('  Site Key: '.(!empty($turnstileSitekey) ? '<fg=green>Configured</>' : '<fg=red>Missing</>'));
55
+        $this->line('  Secret: '.(!empty($turnstileSecret) ? '<fg=green>Configured</>' : '<fg=red>Missing</>'));
56 56
         $this->newLine();
57 57
 
58 58
         // Validation
59
-        $recaptchaReady = $recaptchaEnabled && ! empty($recaptchaSitekey) && ! empty($recaptchaSecret);
60
-        $turnstileReady = $turnstileEnabled && ! empty($turnstileSitekey) && ! empty($turnstileSecret);
59
+        $recaptchaReady = $recaptchaEnabled && !empty($recaptchaSitekey) && !empty($recaptchaSecret);
60
+        $turnstileReady = $turnstileEnabled && !empty($turnstileSitekey) && !empty($turnstileSecret);
61 61
 
62 62
         if ($recaptchaReady && $turnstileReady) {
63 63
             $this->error('⚠ WARNING: Both providers are enabled!');
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
             $this->info('✓ reCAPTCHA is properly configured and active');
71 71
         } elseif ($provider === 'turnstile' && $turnstileReady) {
72 72
             $this->info('✓ Turnstile is properly configured and active');
73
-        } elseif ($provider === 'recaptcha' && ! $recaptchaReady) {
73
+        } elseif ($provider === 'recaptcha' && !$recaptchaReady) {
74 74
             $this->error('✗ reCAPTCHA is selected but not properly configured');
75
-        } elseif ($provider === 'turnstile' && ! $turnstileReady) {
75
+        } elseif ($provider === 'turnstile' && !$turnstileReady) {
76 76
             $this->error('✗ Turnstile is selected but not properly configured');
77 77
         } else {
78 78
             $this->warn('⚠ No CAPTCHA provider is active');
Please login to merge, or discard this patch.
app/Services/SystemMetricsService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             $hourKey = $metric->recorded_at->format('Y-m-d H:00');
51 51
             $hourLabel = $metric->recorded_at->format('H:i');
52 52
 
53
-            if (! isset($hourlyData[$hourKey])) {
53
+            if (!isset($hourlyData[$hourKey])) {
54 54
                 $hourlyData[$hourKey] = [
55 55
                     'time' => $hourLabel,
56 56
                     'values' => [],
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             $dayKey = $metric->recorded_at->format('Y-m-d');
91 91
             $dayLabel = $metric->recorded_at->format('M d');
92 92
 
93
-            if (! isset($dailyData[$dayKey])) {
93
+            if (!isset($dailyData[$dayKey])) {
94 94
                 $dailyData[$dayKey] = [
95 95
                     'time' => $dayLabel,
96 96
                     'values' => [],
Please login to merge, or discard this patch.
app/Rules/TurnstileRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
             return;
20 20
         }
21 21
 
22
-        if (! TurnstileService::verify($value)) {
22
+        if (!TurnstileService::verify($value)) {
23 23
             $fail('The captcha verification failed. Please try again.');
24 24
         }
25 25
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/AdminPageController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             ->limit(10)
57 57
             ->get();
58 58
 
59
-        return $activities->map(function ($activity) {
59
+        return $activities->map(function($activity) {
60 60
             return (object) [
61 61
                 'type' => $activity->activity_type,
62 62
                 'message' => $activity->description,
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
         return response()->json([
80 80
             'success' => true,
81
-            'activities' => array_map(function ($activity) {
81
+            'activities' => array_map(function($activity) {
82 82
                 return [
83 83
                     'type' => $activity->type,
84 84
                     'message' => $activity->message,
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 
266 266
                 // Get number of physical cores
267 267
                 preg_match_all('/^cpu cores\s*:\s*(\d+)/m', $cpuinfo, $coresMatches);
268
-                if (! empty($coresMatches[1])) {
268
+                if (!empty($coresMatches[1])) {
269 269
                     $info['cores'] = (int) $coresMatches[1][0];
270 270
                 }
271 271
 
@@ -275,14 +275,14 @@  discard block
 block discarded – undo
275 275
 
276 276
                 // Get CPU model
277 277
                 preg_match('/^model name\s*:\s*(.+)$/m', $cpuinfo, $modelMatches);
278
-                if (! empty($modelMatches[1])) {
278
+                if (!empty($modelMatches[1])) {
279 279
                     $info['model'] = trim($modelMatches[1]);
280 280
                 }
281 281
 
282 282
                 // If cores is 0, try to get from physical id count
283 283
                 if ($info['cores'] === 0) {
284 284
                     preg_match_all('/^physical id\s*:\s*(\d+)/m', $cpuinfo, $physicalMatches);
285
-                    $uniquePhysical = ! empty($physicalMatches[1]) ? count(array_unique($physicalMatches[1])) : 1;
285
+                    $uniquePhysical = !empty($physicalMatches[1]) ? count(array_unique($physicalMatches[1])) : 1;
286 286
                     $info['cores'] = (int) ($info['threads'] / $uniquePhysical);
287 287
                 }
288 288
             }
Please login to merge, or discard this patch.
app/Observers/UserActivityObserver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@
 block discarded – undo
114 114
      */
115 115
     private function getRoleName(?int $roleId): string
116 116
     {
117
-        if (! $roleId) {
117
+        if (!$roleId) {
118 118
             return 'None';
119 119
         }
120 120
 
Please login to merge, or discard this patch.
app/Console/Commands/BackfillUserActivityStats.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         $type = $this->option('type');
38 38
         $force = $this->option('force');
39 39
 
40
-        if (! in_array($type, ['daily', 'hourly'])) {
40
+        if (!in_array($type, ['daily', 'hourly'])) {
41 41
             $this->error("Invalid type '{$type}'. Must be 'daily' or 'hourly'.");
42 42
 
43 43
             return Command::FAILURE;
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             $date = Carbon::now()->subDays($i)->format('Y-m-d');
69 69
 
70 70
             // Check if stats already exist for this date
71
-            if (! $force && UserActivityStat::where('stat_date', $date)->exists()) {
71
+            if (!$force && UserActivityStat::where('stat_date', $date)->exists()) {
72 72
                 $statsSkipped++;
73 73
                 $progressBar->advance();
74 74
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
             $hour = Carbon::now()->subHours($i)->startOfHour()->format('Y-m-d H:00:00');
129 129
 
130 130
             // Check if stats already exist for this hour
131
-            if (! $force && DB::table('user_activity_stats_hourly')->where('stat_hour', $hour)->exists()) {
131
+            if (!$force && DB::table('user_activity_stats_hourly')->where('stat_hour', $hour)->exists()) {
132 132
                 $statsSkipped++;
133 133
                 $progressBar->advance();
134 134
 
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/DeletedUsersController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             ->when($email !== '', fn ($q) => $q->where('users.email', 'like', "%$email%"))
35 35
             ->when($host !== '', fn ($q) => $q->where('users.host', 'like', "%$host%"))
36 36
             // Created date filters
37
-            ->when($createdFrom !== '' || $createdTo !== '', function ($q) use ($createdFrom, $createdTo) {
37
+            ->when($createdFrom !== '' || $createdTo !== '', function($q) use ($createdFrom, $createdTo) {
38 38
                 try {
39 39
                     if ($createdFrom !== '' && $createdTo !== '') {
40 40
                         $from = Carbon::createFromFormat('Y-m-d', $createdFrom)->startOfDay();
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                 }
53 53
             })
54 54
             // Deleted date filters
55
-            ->when($deletedFrom !== '' || $deletedTo !== '', function ($q) use ($deletedFrom, $deletedTo) {
55
+            ->when($deletedFrom !== '' || $deletedTo !== '', function($q) use ($deletedFrom, $deletedTo) {
56 56
                 try {
57 57
                     if ($deletedFrom !== '' && $deletedTo !== '') {
58 58
                         $from = Carbon::createFromFormat('Y-m-d', $deletedFrom)->startOfDay();
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
         $userIds = $request->input('user_ids', []);
110 110
 
111 111
         // Better validation with specific error messages
112
-        if (empty($action) || ! in_array($action, ['restore', 'delete'], true)) {
112
+        if (empty($action) || !in_array($action, ['restore', 'delete'], true)) {
113 113
             return redirect()->route('admin.deleted.users.index')->with('error', 'Please select a valid action.');
114 114
         }
115 115
 
116
-        if (! is_array($userIds)) {
116
+        if (!is_array($userIds)) {
117 117
             return redirect()->route('admin.deleted.users.index')->with('error', 'Invalid user selection format.');
118 118
         }
119 119
 
Please login to merge, or discard this patch.
app/Models/User.php 1 patch
Spacing   +16 added lines, -16 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
 
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
             'rate_limit' => $rateLimit ? $rateLimit['rate_limit'] : 60,
308 308
         ];
309 309
 
310
-        if (! empty($email)) {
310
+        if (!empty($email)) {
311 311
             $email = trim($email);
312 312
             $sql += ['email' => $email];
313 313
         }
@@ -356,10 +356,10 @@  discard block
 block discarded – undo
356 356
     {
357 357
         $user = self::find($uid);
358 358
         $currRoleExp = $user->rolechangedate ?? now()->toDateTimeString();
359
-        if (! empty($date)) {
359
+        if (!empty($date)) {
360 360
             $user->update(['rolechangedate' => $date]);
361 361
         }
362
-        if (empty($date) && ! empty($addYear)) {
362
+        if (empty($date) && !empty($addYear)) {
363 363
             $user->update(['rolechangedate' => Carbon::createFromDate($currRoleExp)->addYears($addYear)]);
364 364
         }
365 365
     }
@@ -416,12 +416,12 @@  discard block
 block discarded – undo
416 416
         return self::fromQuery(
417 417
             sprintf(
418 418
                 $query,
419
-                ! empty($userName) ? 'AND users.username '.'LIKE '.escapeString('%'.$userName.'%') : '',
420
-                ! empty($email) ? 'AND users.email '.'LIKE '.escapeString('%'.$email.'%') : '',
421
-                ! empty($host) ? 'AND users.host '.'LIKE '.escapeString('%'.$host.'%') : '',
422
-                (! empty($role) ? ('AND users.roles_id = '.$role) : ''),
423
-                ! empty($createdFrom) ? 'AND users.created_at >= '.escapeString($createdFrom.' 00:00:00') : '',
424
-                ! empty($createdTo) ? 'AND users.created_at <= '.escapeString($createdTo.' 23:59:59') : '',
419
+                !empty($userName) ? 'AND users.username '.'LIKE '.escapeString('%'.$userName.'%') : '',
420
+                !empty($email) ? 'AND users.email '.'LIKE '.escapeString('%'.$email.'%') : '',
421
+                !empty($host) ? 'AND users.host '.'LIKE '.escapeString('%'.$host.'%') : '',
422
+                (!empty($role) ? ('AND users.roles_id = '.$role) : ''),
423
+                !empty($createdFrom) ? 'AND users.created_at >= '.escapeString($createdFrom.' 00:00:00') : '',
424
+                !empty($createdTo) ? 'AND users.created_at <= '.escapeString($createdTo.' 23:59:59') : '',
425 425
                 $order[0],
426 426
                 $order[1],
427 427
                 ($start === false ? '' : ('LIMIT '.$offset.' OFFSET '.$start))
@@ -533,7 +533,7 @@  discard block
 block discarded – undo
533 533
 
534 534
     public static function isValidUrl($url): bool
535 535
     {
536
-        return (! preg_match('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i', $url)) ? false : true;
536
+        return (!preg_match('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i', $url)) ? false : true;
537 537
     }
538 538
 
539 539
     /**
@@ -569,7 +569,7 @@  discard block
 block discarded – undo
569 569
 
570 570
         // Make sure this is the last check, as if a further validation check failed, the invite would still have been used up.
571 571
         $invitedBy = 0;
572
-        if (! $forceInviteMode && (int) Settings::settingValue('registerstatus') === Settings::REGISTER_STATUS_INVITE) {
572
+        if (!$forceInviteMode && (int) Settings::settingValue('registerstatus') === Settings::REGISTER_STATUS_INVITE) {
573 573
             if ($inviteCode === '') {
574 574
                 return self::ERR_SIGNUP_BADINVITECODE;
575 575
             }
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
     public static function checkAndUseInvite(string $inviteCode): int
590 590
     {
591 591
         $invite = Invitation::findValidByToken($inviteCode);
592
-        if (! $invite) {
592
+        if (!$invite) {
593 593
             return -1;
594 594
         }
595 595
 
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
     public static function add(string $userName, string $password, string $email, int $role, ?string $notes = '', string $host = '', int $invites = Invitation::DEFAULT_INVITES, int $invitedBy = 0)
606 606
     {
607 607
         $password = self::hashPassword($password);
608
-        if (! $password) {
608
+        if (!$password) {
609 609
             return false;
610 610
         }
611 611
 
@@ -647,9 +647,9 @@  discard block
 block discarded – undo
647 647
 
648 648
         $cats = ['view console', 'view movies', 'view audio', 'view tv', 'view pc', 'view adult', 'view books', 'view other'];
649 649
 
650
-        if (! empty($allowed)) {
650
+        if (!empty($allowed)) {
651 651
             foreach ($cats as $cat) {
652
-                if (! \in_array($cat, $allowed, false)) {
652
+                if (!\in_array($cat, $allowed, false)) {
653 653
                     $ret[] = match ($cat) {
654 654
                         'view console' => 1000,
655 655
                         'view movies' => 2000,
Please login to merge, or discard this patch.
app/Http/Controllers/RssController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
             return $user;
31 31
         }
32 32
 
33
-        $outputXML = (! ($request->has('o') && $request->input('o') === 'json'));
33
+        $outputXML = (!($request->has('o') && $request->input('o') === 'json'));
34 34
 
35 35
         $userNum = ($request->has('num') && is_numeric($request->input('num')) ? abs($request->input('num')) : 0);
36 36
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         $userAirDate = $request->has('airdate') && is_numeric($request->input('airdate')) ? abs($request->input('airdate')) : -1;
56 56
         $userNum = ($request->has('num') && is_numeric($request->input('num')) ? abs($request->input('num')) : 0);
57 57
         $relData = $rss->getShowsRss($userNum, $user['user_id'], User::getCategoryExclusionById($user['user_id']), $userAirDate);
58
-        $outputXML = (! ($request->has('o') && $request->input('o') === 'json'));
58
+        $outputXML = (!($request->has('o') && $request->input('o') === 'json'));
59 59
 
60 60
         $rss->output($relData, $user['params'], $outputXML, $offset, 'rss');
61 61
     }
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         } elseif ($request->has('anidb')) {
83 83
             $userAnidb = ((int) $request->input('anidb') === 0 ? -1 : $request->input('anidb') + 0);
84 84
         }
85
-        $outputXML = (! ($request->has('o') && $request->input('o') === 'json'));
85
+        $outputXML = (!($request->has('o') && $request->input('o') === 'json'));
86 86
         $relData = $rss->getRss(Arr::wrap(0), $userShow, $userAnidb, $user['user_id'], $userAirDate, $userLimit, $userNum);
87 87
         $rss->output($relData, $user['params'], $outputXML, $offset, 'rss');
88 88
     }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
         if (is_object($user)) {
128 128
             return $user;
129 129
         }
130
-        $outputXML = (! ($request->has('o') && $request->input('o') === 'json'));
130
+        $outputXML = (!($request->has('o') && $request->input('o') === 'json'));
131 131
         $userAirDate = $request->has('airdate') && is_numeric($request->input('airdate')) ? abs($request->input('airdate')) : -1;
132 132
         $userNum = ($request->has('num') && is_numeric($request->input('num')) ? abs($request->input('num')) : 0);
133 133
         $userLimit = $request->has('limit') && is_numeric($request->input('limit')) ? $request->input('limit') : 100;
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
         } elseif ($request->has('anidb')) {
168 168
             $userAnidb = ((int) $request->input('anidb') === 0 ? -1 : $request->input('anidb') + 0);
169 169
         }
170
-        $outputXML = (! ($request->has('o') && $request->input('o') === 'json'));
170
+        $outputXML = (!($request->has('o') && $request->input('o') === 'json'));
171 171
         $relData = $rss->getRss($categoryId, $userShow, $userAnidb, $user['user_id'], $userAirDate, $userLimit, $userNum);
172 172
         $rss->output($relData, $user['params'], $outputXML, $offset, 'rss');
173 173
     }
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         if (is_object($user)) {
184 184
             return $user;
185 185
         }
186
-        $outputXML = (! ($request->has('o') && $request->input('o') === 'json'));
186
+        $outputXML = (!($request->has('o') && $request->input('o') === 'json'));
187 187
 
188 188
         $relData = $rss->getTrendingMoviesRss();
189 189
 
@@ -201,7 +201,7 @@  discard block
 block discarded – undo
201 201
         if (is_object($user)) {
202 202
             return $user;
203 203
         }
204
-        $outputXML = (! ($request->has('o') && $request->input('o') === 'json'));
204
+        $outputXML = (!($request->has('o') && $request->input('o') === 'json'));
205 205
 
206 206
         $relData = $rss->getTrendingShowsRss();
207 207
 
Please login to merge, or discard this patch.