Passed
Push — master ( a7da05...21ccf8 )
by Darko
10:04
created
app/Models/User.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
      */
406 406
     public function getPendingRole(): ?Role
407 407
     {
408
-        if (! $this->hasPendingRole()) {
408
+        if (!$this->hasPendingRole()) {
409 409
             return null;
410 410
         }
411 411
 
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
      */
418 418
     public function cancelPendingRole(): bool
419 419
     {
420
-        if (! $this->hasPendingRole()) {
420
+        if (!$this->hasPendingRole()) {
421 421
             return false;
422 422
         }
423 423
 
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
             ->orderBy('effective_date', 'asc')
449 449
             ->get();
450 450
 
451
-        return $stackedHistory->map(function ($history) {
451
+        return $stackedHistory->map(function($history) {
452 452
             $role = Role::find($history->new_role_id);
453 453
             return [
454 454
                 'role' => $role,
@@ -666,14 +666,14 @@  discard block
 block discarded – undo
666 666
             ? Role::find((int) $role)
667 667
             : Role::where('name', $role)->first();
668 668
 
669
-        if (! $roleModel) {
669
+        if (!$roleModel) {
670 670
             Log::error('Role not found', ['role' => $role]);
671 671
 
672 672
             return false;
673 673
         }
674 674
 
675 675
         $user = static::find($uid);
676
-        if (! $user) {
676
+        if (!$user) {
677 677
             Log::error('User not found', ['uid' => $uid]);
678 678
 
679 679
             return false;
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
             if ($pendingRole && $pendingStartDate) {
799 799
                 // Calculate when the pending role would expire
800 800
                 $pendingRoleBaseDays = $pendingRole->addyears * self::DAYS_PER_YEAR;
801
-                $pendingRolePromotionDays = ! in_array($pendingRole->name, self::PROMOTION_EXCLUDED_ROLES, true)
801
+                $pendingRolePromotionDays = !in_array($pendingRole->name, self::PROMOTION_EXCLUDED_ROLES, true)
802 802
                     ? RolePromotion::calculateAdditionalDays($pendingRole->id)
803 803
                     : 0;
804 804
                 $pendingRoleTotalDays = $pendingRoleBaseDays + $pendingRolePromotionDays;
@@ -837,7 +837,7 @@  discard block
 block discarded – undo
837 837
         ]);
838 838
 
839 839
         $baseDays = ($addYears ?? $roleModel->addyears) * self::DAYS_PER_YEAR;
840
-        $promotionDays = ! in_array($roleModel->name, self::PROMOTION_EXCLUDED_ROLES, true) && $applyPromotions
840
+        $promotionDays = !in_array($roleModel->name, self::PROMOTION_EXCLUDED_ROLES, true) && $applyPromotions
841 841
             ? RolePromotion::calculateAdditionalDays($roleModel->id)
842 842
             : 0;
843 843
         $totalDays = $baseDays + $promotionDays;
@@ -882,7 +882,7 @@  discard block
 block discarded – undo
882 882
         bool $preserveCurrentExpiry,
883 883
     ): bool {
884 884
         $baseDays = ($addYears ?? $roleModel->addyears) * self::DAYS_PER_YEAR;
885
-        $promotionDays = ! in_array($roleModel->name, self::PROMOTION_EXCLUDED_ROLES, true) && $applyPromotions
885
+        $promotionDays = !in_array($roleModel->name, self::PROMOTION_EXCLUDED_ROLES, true) && $applyPromotions
886 886
             ? RolePromotion::calculateAdditionalDays($roleModel->id)
887 887
             : 0;
888 888
         $totalDays = $baseDays + $promotionDays;
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
      */
981 981
     private static function processExpiredRoles(CarbonImmutable $now): void
982 982
     {
983
-        static::expired()->each(function (self $user) use ($now) {
983
+        static::expired()->each(function(self $user) use ($now) {
984 984
             $oldRoleId = $user->roles_id;
985 985
             $oldExpiryDate = $user->rolechangedate;
986 986
 
@@ -1006,7 +1006,7 @@  discard block
 block discarded – undo
1006 1006
         CarbonImmutable $now,
1007 1007
     ): void {
1008 1008
         $roleModel = Role::find($user->pending_roles_id);
1009
-        if (! $roleModel) {
1009
+        if (!$roleModel) {
1010 1010
             return;
1011 1011
         }
1012 1012
 
@@ -1162,7 +1162,7 @@  discard block
 block discarded – undo
1162 1162
      */
1163 1163
     public static function checkPassword(string $password, string $hash, int $userId = -1): bool
1164 1164
     {
1165
-        if (! Hash::check($password, $hash)) {
1165
+        if (!Hash::check($password, $hash)) {
1166 1166
             return false;
1167 1167
         }
1168 1168
 
@@ -1300,7 +1300,7 @@  discard block
 block discarded – undo
1300 1300
         }
1301 1301
 
1302 1302
         $invitedBy = 0;
1303
-        if (! $forceInviteMode && (int) Settings::settingValue('registerstatus') === Settings::REGISTER_STATUS_INVITE) {
1303
+        if (!$forceInviteMode && (int) Settings::settingValue('registerstatus') === Settings::REGISTER_STATUS_INVITE) {
1304 1304
             if ($inviteCode === '') {
1305 1305
                 return SignupError::BAD_INVITE_CODE->value;
1306 1306
             }
@@ -1329,7 +1329,7 @@  discard block
 block discarded – undo
1329 1329
     public static function checkAndUseInvite(string $inviteCode): int
1330 1330
     {
1331 1331
         $invite = Invitation::findValidByToken($inviteCode);
1332
-        if (! $invite) {
1332
+        if (!$invite) {
1333 1333
             return -1;
1334 1334
         }
1335 1335
 
@@ -1401,7 +1401,7 @@  discard block
 block discarded – undo
1401 1401
 
1402 1402
         $excludedRoots = [];
1403 1403
         foreach ($categoryPermissions as $permission => $rootId) {
1404
-            if (! in_array($permission, $allowed, false)) {
1404
+            if (!in_array($permission, $allowed, false)) {
1405 1405
                 $excludedRoots[] = $rootId;
1406 1406
             }
1407 1407
         }
Please login to merge, or discard this patch.