Completed
Push — master ( 8f73b5...a0b9ff )
by Darko
39s queued 20s
created
app/Models/User.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     {
255 255
         $res = self::query()->where('email', '<>', '[email protected]');
256 256
 
257
-        if (! empty($role)) {
257
+        if (!empty($role)) {
258 258
             $res->where('roles_id', $role);
259 259
         }
260 260
 
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
             'rate_limit' => $rateLimit ? $rateLimit['rate_limit'] : 60,
296 296
         ];
297 297
 
298
-        if (! empty($email)) {
298
+        if (!empty($email)) {
299 299
             $email = trim($email);
300 300
             $sql += ['email' => $email];
301 301
         }
@@ -344,10 +344,10 @@  discard block
 block discarded – undo
344 344
     {
345 345
         $user = self::find($uid);
346 346
         $currRoleExp = $user->rolechangedate ?? now()->toDateTimeString();
347
-        if (! empty($date)) {
347
+        if (!empty($date)) {
348 348
             $user->update(['rolechangedate' => $date]);
349 349
         }
350
-        if (empty($date) && ! empty($addYear)) {
350
+        if (empty($date) && !empty($addYear)) {
351 351
             $user->update(['rolechangedate' => Carbon::createFromDate($currRoleExp)->addYears($addYear)]);
352 352
         }
353 353
     }
@@ -404,10 +404,10 @@  discard block
 block discarded – undo
404 404
         return self::fromQuery(
405 405
             sprintf(
406 406
                 $query,
407
-                ! empty($userName) ? 'AND users.username '.'LIKE '.escapeString('%'.$userName.'%') : '',
408
-                ! empty($email) ? 'AND users.email '.'LIKE '.escapeString('%'.$email.'%') : '',
409
-                ! empty($host) ? 'AND users.host '.'LIKE '.escapeString('%'.$host.'%') : '',
410
-                (! empty($role) ? ('AND users.roles_id = '.$role) : ''),
407
+                !empty($userName) ? 'AND users.username '.'LIKE '.escapeString('%'.$userName.'%') : '',
408
+                !empty($email) ? 'AND users.email '.'LIKE '.escapeString('%'.$email.'%') : '',
409
+                !empty($host) ? 'AND users.host '.'LIKE '.escapeString('%'.$host.'%') : '',
410
+                (!empty($role) ? ('AND users.roles_id = '.$role) : ''),
411 411
                 $order[0],
412 412
                 $order[1],
413 413
                 ($start === false ? '' : ('LIMIT '.$offset.' OFFSET '.$start))
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 
520 520
     public static function isValidUrl($url): bool
521 521
     {
522
-        return (! preg_match('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i', $url)) ? false : true;
522
+        return (!preg_match('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i', $url)) ? false : true;
523 523
     }
524 524
 
525 525
     /**
@@ -555,7 +555,7 @@  discard block
 block discarded – undo
555 555
 
556 556
         // Make sure this is the last check, as if a further validation check failed, the invite would still have been used up.
557 557
         $invitedBy = 0;
558
-        if (! $forceInviteMode && (int) Settings::settingValue('registerstatus') === Settings::REGISTER_STATUS_INVITE) {
558
+        if (!$forceInviteMode && (int) Settings::settingValue('registerstatus') === Settings::REGISTER_STATUS_INVITE) {
559 559
             if ($inviteCode === '') {
560 560
                 return self::ERR_SIGNUP_BADINVITECODE;
561 561
             }
@@ -575,7 +575,7 @@  discard block
 block discarded – undo
575 575
     public static function checkAndUseInvite(string $inviteCode): int
576 576
     {
577 577
         $invite = Invitation::getInvite($inviteCode);
578
-        if (! $invite) {
578
+        if (!$invite) {
579 579
             return -1;
580 580
         }
581 581
 
@@ -591,7 +591,7 @@  discard block
 block discarded – undo
591 591
     public static function add(string $userName, string $password, string $email, int $role, ?string $notes = '', string $host = '', int $invites = Invitation::DEFAULT_INVITES, int $invitedBy = 0)
592 592
     {
593 593
         $password = self::hashPassword($password);
594
-        if (! $password) {
594
+        if (!$password) {
595 595
             return false;
596 596
         }
597 597
 
@@ -633,9 +633,9 @@  discard block
 block discarded – undo
633 633
 
634 634
         $cats = ['view console', 'view movies', 'view audio', 'view tv', 'view pc', 'view adult', 'view books', 'view other'];
635 635
 
636
-        if (! empty($allowed)) {
636
+        if (!empty($allowed)) {
637 637
             foreach ($cats as $cat) {
638
-                if (! \in_array($cat, $allowed, false)) {
638
+                if (!\in_array($cat, $allowed, false)) {
639 639
                     $ret[] = match ($cat) {
640 640
                         'view console' => 1000,
641 641
                         'view movies' => 2000,
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/LoginController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
             if ($user !== null) {
74 74
                 $rememberMe = $request->has('rememberme') && $request->input('rememberme') === 'on';
75 75
 
76
-                if (! $user->isVerified() || $user->isPendingVerification()) {
76
+                if (!$user->isVerified() || $user->isPendingVerification()) {
77 77
                     $request->session()->flash('message', 'You have not verified your email address!');
78 78
 
79 79
                     return redirect()->to('login');
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/ForgotPasswordController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,12 +45,12 @@
 block discarded – undo
45 45
         if (empty($email) && empty($rssToken)) {
46 46
             app('smarty.view')->assign('error', 'Missing parameter (email and/or apikey) to send password reset');
47 47
         } else {
48
-            if (config('captcha.enabled') === true && (! empty(config('captcha.secret')) && ! empty(config('captcha.sitekey')))) {
48
+            if (config('captcha.enabled') === true && (!empty(config('captcha.secret')) && !empty(config('captcha.sitekey')))) {
49 49
             }
50 50
             //
51 51
             // Check users exists and send an email
52 52
             //
53
-            $ret = ! empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email);
53
+            $ret = !empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email);
54 54
             if ($ret === null) {
55 55
                 app('smarty.view')->assign('error', 'The email or apikey are not recognised.');
56 56
                 $sent = true;
Please login to merge, or discard this patch.