Passed
Push — master ( bd753d...066495 )
by Darko
10:20
created
app/Http/Controllers/Auth/RegisterController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                 // Get the default user role.
165 165
                 $userDefault = Role::query()->where('isdefault', '=', 1)->first();
166 166
 
167
-                if (! empty($error)) {
167
+                if (!empty($error)) {
168 168
                     return $this->showRegistrationForm($request, $error);
169 169
                 }
170 170
 
@@ -177,13 +177,13 @@  discard block
 block discarded – undo
177 177
                     $invitedBy = 0;
178 178
                     $invitation = null;
179 179
 
180
-                    if (! empty($inviteCode)) {
180
+                    if (!empty($inviteCode)) {
181 181
                         $invitation = Invitation::findValidByToken($inviteCode);
182 182
                         if ($invitation) {
183 183
                             $invitedBy = $invitation->invited_by;
184 184
 
185 185
                             // Validate email matches invitation
186
-                            if (! empty($invitation->email) && $invitation->email !== $email) {
186
+                            if (!empty($invitation->email) && $invitation->email !== $email) {
187 187
                                 $error = 'Email address does not match the invitation.';
188 188
 
189 189
                                 return $this->showRegistrationForm($request, $error);
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
             case 'view':
238 238
                 // Don't set showRegister here - let showRegistrationForm handle it
239 239
                 // Only validate invite code if present
240
-                if (($inviteCode !== null) && ! $this->isInvitationTokenValid($inviteCode)) {
240
+                if (($inviteCode !== null) && !$this->isInvitationTokenValid($inviteCode)) {
241 241
                     $error = 'Invalid invitation token!';
242 242
                 }
243 243
                 break;
@@ -263,14 +263,14 @@  discard block
 block discarded – undo
263 263
         $emailFromInvite = '';
264 264
 
265 265
         if ((int) Settings::settingValue('registerstatus') === Settings::REGISTER_STATUS_INVITE) {
266
-            if (! empty($inviteCode)) {
266
+            if (!empty($inviteCode)) {
267 267
                 if ($this->isInvitationTokenValid($inviteCode)) {
268 268
                     $error = '';
269 269
                     $showRegister = 1;
270 270
 
271 271
                     // Pre-fill email if invitation has one
272 272
                     $invitation = Invitation::findValidByToken($inviteCode);
273
-                    if ($invitation && ! empty($invitation->email)) {
273
+                    if ($invitation && !empty($invitation->email)) {
274 274
                         $emailFromInvite = $invitation->email;
275 275
                     }
276 276
                 } else {
@@ -311,12 +311,12 @@  discard block
 block discarded – undo
311 311
 
312 312
         $invitation = Invitation::findValidByToken($token);
313 313
 
314
-        if (! $invitation) {
314
+        if (!$invitation) {
315 315
             return false;
316 316
         }
317 317
 
318 318
         // If invitation has specific email, validate it matches
319
-        if (! empty($invitation->email) && $invitation->email !== $email) {
319
+        if (!empty($invitation->email) && $invitation->email !== $email) {
320 320
             return false;
321 321
         }
322 322
 
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/ForgotPasswordController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
         }
60 60
 
61 61
         // Check users exists and send an email
62
-        $ret = ! empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email);
62
+        $ret = !empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email);
63 63
         if ($ret === null) {
64 64
             return view('auth.passwords.email')->withErrors(['error' => 'The email or apikey are not recognised.']);
65 65
         }
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/LoginController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 
76 76
         if ($validator->passes()) {
77 77
             $user = User::query()
78
-                ->where(function ($query) use ($request) {
78
+                ->where(function($query) use ($request) {
79 79
                     $query->where('username', $request->input('username'))
80 80
                         ->orWhere('email', $request->input('username'));
81 81
                 })
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
                 $rememberMe = $request->has('rememberme') && $request->input('rememberme') === 'on';
93 93
 
94
-                if (! $user->isVerified() || $user->isPendingVerification()) {
94
+                if (!$user->isVerified() || $user->isPendingVerification()) {
95 95
                     $request->session()->flash('message', 'You have not verified your email address!');
96 96
 
97 97
                     return redirect()->to('login');
@@ -210,14 +210,14 @@  discard block
 block discarded – undo
210 210
                     if ($remainingMinutes > 0) {
211 211
                         // Create a cookie with proper settings for persistence
212 212
                         $cookie = cookie(
213
-                            '2fa_trusted_device',    // name
214
-                            $trustedDeviceCookie,    // value
215
-                            $remainingMinutes,       // minutes remaining
216
-                            '/',                     // path
213
+                            '2fa_trusted_device', // name
214
+                            $trustedDeviceCookie, // value
215
+                            $remainingMinutes, // minutes remaining
216
+                            '/', // path
217 217
                             config('session.domain'), // use session domain config
218 218
                             config('session.secure'), // use session secure config
219
-                            false,                   // httpOnly
220
-                            false,                   // raw
219
+                            false, // httpOnly
220
+                            false, // raw
221 221
                             config('session.same_site', 'lax') // use session same_site config
222 222
                         );
223 223
 
Please login to merge, or discard this patch.
app/Extensions/helper/helpers.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 use Symfony\Component\Process\Process;
17 17
 use Zip as ZipStream;
18 18
 
19
-if (! function_exists('getRawHtml')) {
19
+if (!function_exists('getRawHtml')) {
20 20
     /**
21 21
      * @param  bool  $cookie
22 22
      * @return bool|mixed|string
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     }
52 52
 }
53 53
 
54
-if (! function_exists('makeFieldLinks')) {
54
+if (!function_exists('makeFieldLinks')) {
55 55
     /**
56 56
      * @return string
57 57
      *
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     }
82 82
 }
83 83
 
84
-if (! function_exists('getUserBrowseOrder')) {
84
+if (!function_exists('getUserBrowseOrder')) {
85 85
     /**
86 86
      * @param  string  $orderBy
87 87
      */
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     }
108 108
 }
109 109
 
110
-if (! function_exists('getUserBrowseOrdering')) {
110
+if (!function_exists('getUserBrowseOrdering')) {
111 111
     function getUserBrowseOrdering(): array
112 112
     {
113 113
         return [
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     }
138 138
 }
139 139
 
140
-if (! function_exists('getSimilarName')) {
140
+if (!function_exists('getSimilarName')) {
141 141
     /**
142 142
      * @param  string  $name
143 143
      */
@@ -147,14 +147,14 @@  discard block
 block discarded – undo
147 147
     }
148 148
 }
149 149
 
150
-if (! function_exists('color')) {
150
+if (!function_exists('color')) {
151 151
     function color(string $string = ''): Color
152 152
     {
153 153
         return new Color($string);
154 154
     }
155 155
 }
156 156
 
157
-if (! function_exists('human_filesize')) {
157
+if (!function_exists('human_filesize')) {
158 158
     /**
159 159
      * @param  int  $decimals
160 160
      */
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     }
168 168
 }
169 169
 
170
-if (! function_exists('bcdechex')) {
170
+if (!function_exists('bcdechex')) {
171 171
     /**
172 172
      * @return string
173 173
      */
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
     }
185 185
 }
186 186
 
187
-if (! function_exists('runCmd')) {
187
+if (!function_exists('runCmd')) {
188 188
     /**
189 189
      * Run CLI command.
190 190
      *
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
     }
213 213
 }
214 214
 
215
-if (! function_exists('escapeString')) {
215
+if (!function_exists('escapeString')) {
216 216
     /**
217 217
      * @return string
218 218
      */
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
     }
223 223
 }
224 224
 
225
-if (! function_exists('realDuration')) {
225
+if (!function_exists('realDuration')) {
226 226
     /**
227 227
      * @return string
228 228
      */
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
     }
235 235
 }
236 236
 
237
-if (! function_exists('is_it_json')) {
237
+if (!function_exists('is_it_json')) {
238 238
     /**
239 239
      * @param  array|string  $isIt
240 240
      * @return bool
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
     return $zipped;
278 278
 }
279 279
 
280
-if (! function_exists('release_flag')) {
280
+if (!function_exists('release_flag')) {
281 281
     // Function inspired by c0r3@newznabforums adds country flags on the browse page.
282 282
     /**
283 283
      * @param  string  $text  Text to match against.
@@ -415,7 +415,7 @@  discard block
 block discarded – undo
415 415
     }
416 416
 }
417 417
 
418
-if (! function_exists('getReleaseCover')) {
418
+if (!function_exists('getReleaseCover')) {
419 419
     /**
420 420
      * Get the cover image URL for a release based on its type and ID
421 421
      *
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
         $coverId = null;
429 429
 
430 430
         // Helper function to get value from object or array
431
-        $getValue = function ($data, $key) {
431
+        $getValue = function($data, $key) {
432 432
             if (is_array($data)) {
433 433
                 return $data[$key] ?? null;
434 434
             } elseif (is_object($data)) {
@@ -447,25 +447,25 @@  discard block
 block discarded – undo
447 447
         $xxxinfo_id = $getValue($release, 'xxxinfo_id');
448 448
         $anidbid = $getValue($release, 'anidbid');
449 449
 
450
-        if (! empty($imdbid) && $imdbid > 0) {
450
+        if (!empty($imdbid) && $imdbid > 0) {
451 451
             $coverType = 'movies';
452 452
             $coverId = str_pad($imdbid, 7, '0', STR_PAD_LEFT);
453
-        } elseif (! empty($musicinfo_id)) {
453
+        } elseif (!empty($musicinfo_id)) {
454 454
             $coverType = 'music';
455 455
             $coverId = $musicinfo_id;
456
-        } elseif (! empty($consoleinfo_id)) {
456
+        } elseif (!empty($consoleinfo_id)) {
457 457
             $coverType = 'console';
458 458
             $coverId = $consoleinfo_id;
459
-        } elseif (! empty($bookinfo_id)) {
459
+        } elseif (!empty($bookinfo_id)) {
460 460
             $coverType = 'book';
461 461
             $coverId = $bookinfo_id;
462
-        } elseif (! empty($gamesinfo_id)) {
462
+        } elseif (!empty($gamesinfo_id)) {
463 463
             $coverType = 'games';
464 464
             $coverId = $gamesinfo_id;
465
-        } elseif (! empty($xxxinfo_id)) {
465
+        } elseif (!empty($xxxinfo_id)) {
466 466
             $coverType = 'xxx';
467 467
             $coverId = $xxxinfo_id;
468
-        } elseif (! empty($anidbid)) {
468
+        } elseif (!empty($anidbid)) {
469 469
             $coverType = 'anime';
470 470
             $coverId = $anidbid;
471 471
         }
@@ -481,10 +481,10 @@  discard block
 block discarded – undo
481 481
     }
482 482
 }
483 483
 
484
-if (! function_exists('sanitize')) {
484
+if (!function_exists('sanitize')) {
485 485
     function sanitize(array|string $phrases, array $doNotSanitize = []): string
486 486
     {
487
-        if (! is_array($phrases)) {
487
+        if (!is_array($phrases)) {
488 488
             $wordArray = explode(' ', str_replace('.', ' ', $phrases));
489 489
         } else {
490 490
             $wordArray = $phrases;
@@ -495,9 +495,9 @@  discard block
 block discarded – undo
495 495
         foreach ($wordArray as $words) {
496 496
             $words = preg_split('/\s+/', $words);
497 497
             foreach ($words as $st) {
498
-                if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) {
498
+                if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) {
499 499
                     $str = $st;
500
-                } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) {
500
+                } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) {
501 501
                     $str = $st;
502 502
                 } else {
503 503
                     $str = Sanitizer::escape($st, $doNotSanitize);
@@ -512,7 +512,7 @@  discard block
 block discarded – undo
512 512
     }
513 513
 }
514 514
 
515
-if (! function_exists('formatBytes')) {
515
+if (!function_exists('formatBytes')) {
516 516
     /**
517 517
      * Format bytes into human-readable file size.
518 518
      *
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
     }
532 532
 }
533 533
 
534
-if (! function_exists('csp_nonce')) {
534
+if (!function_exists('csp_nonce')) {
535 535
     /**
536 536
      * Generate a CSP nonce for inline scripts
537 537
      * This should be stored in the request and reused across the request lifecycle
Please login to merge, or discard this patch.
app/Models/Settings.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@
 block discarded – undo
116 116
 
117 117
         // If there's an override and no mutator has been explicitly defined on
118 118
         // the model then use the override value
119
-        if ($override && ! $this->hasGetMutator($key)) {
119
+        if ($override && !$this->hasGetMutator($key)) {
120 120
             return $override->value;
121 121
         }
122 122
 
Please login to merge, or discard this patch.
app/Support/CaptchaHelper.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -15,12 +15,12 @@  discard block
 block discarded – undo
15 15
 
16 16
         // Enforce that both providers cannot be enabled at the same time
17 17
         $recaptchaEnabled = config('captcha.recaptcha.enabled') === true
18
-            && ! empty(config('captcha.recaptcha.sitekey'))
19
-            && ! empty(config('captcha.recaptcha.secret'));
18
+            && !empty(config('captcha.recaptcha.sitekey'))
19
+            && !empty(config('captcha.recaptcha.secret'));
20 20
 
21 21
         $turnstileEnabled = config('captcha.turnstile.enabled') === true
22
-            && ! empty(config('captcha.turnstile.sitekey'))
23
-            && ! empty(config('captcha.turnstile.secret'));
22
+            && !empty(config('captcha.turnstile.sitekey'))
23
+            && !empty(config('captcha.turnstile.secret'));
24 24
 
25 25
         // If both are configured as enabled, log a warning and use the configured provider
26 26
         if ($recaptchaEnabled && $turnstileEnabled) {
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
 
34 34
         // Default to reCAPTCHA
35 35
         return $recaptchaEnabled || config('captcha.enabled') === true
36
-            && ! empty(config('captcha.sitekey'))
37
-            && ! empty(config('captcha.secret'));
36
+            && !empty(config('captcha.sitekey'))
37
+            && !empty(config('captcha.secret'));
38 38
     }
39 39
 
40 40
     /**
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
      */
51 51
     public static function display(array $attributes = []): string
52 52
     {
53
-        if (! self::isEnabled()) {
53
+        if (!self::isEnabled()) {
54 54
             return '';
55 55
         }
56 56
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
      */
70 70
     public static function renderJs(): string
71 71
     {
72
-        if (! self::isEnabled()) {
72
+        if (!self::isEnabled()) {
73 73
             return '';
74 74
         }
75 75
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
      */
103 103
     public static function getValidationRules(): array
104 104
     {
105
-        if (! self::isEnabled()) {
105
+        if (!self::isEnabled()) {
106 106
             return [];
107 107
         }
108 108
 
Please login to merge, or discard this patch.