@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | { |
251 | 251 | $res = self::query()->where('email', '<>', '[email protected]'); |
252 | 252 | |
253 | - if (! empty($role)) { |
|
253 | + if (!empty($role)) { |
|
254 | 254 | $res->where('roles_id', $role); |
255 | 255 | } |
256 | 256 | |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | 'rate_limit' => $rateLimit ? $rateLimit['rate_limit'] : 60, |
292 | 292 | ]; |
293 | 293 | |
294 | - if (! empty($email)) { |
|
294 | + if (!empty($email)) { |
|
295 | 295 | $email = trim($email); |
296 | 296 | $sql += ['email' => $email]; |
297 | 297 | } |
@@ -336,10 +336,10 @@ discard block |
||
336 | 336 | { |
337 | 337 | $user = self::find($uid); |
338 | 338 | $currRoleExp = $user->rolechangedate ?? now()->toDateTimeString(); |
339 | - if (! empty($date)) { |
|
339 | + if (!empty($date)) { |
|
340 | 340 | $user->update(['rolechangedate' => $date]); |
341 | 341 | } |
342 | - if (empty($date) && ! empty($addYear)) { |
|
342 | + if (empty($date) && !empty($addYear)) { |
|
343 | 343 | $user->update(['rolechangedate' => Carbon::createFromDate($currRoleExp)->addYears($addYear)]); |
344 | 344 | } |
345 | 345 | } |
@@ -396,10 +396,10 @@ discard block |
||
396 | 396 | return self::fromQuery( |
397 | 397 | sprintf( |
398 | 398 | $query, |
399 | - ! empty($userName) ? 'AND users.username '.'LIKE '.escapeString('%'.$userName.'%') : '', |
|
400 | - ! empty($email) ? 'AND users.email '.'LIKE '.escapeString('%'.$email.'%') : '', |
|
401 | - ! empty($host) ? 'AND users.host '.'LIKE '.escapeString('%'.$host.'%') : '', |
|
402 | - (! empty($role) ? ('AND users.roles_id = '.$role) : ''), |
|
399 | + !empty($userName) ? 'AND users.username '.'LIKE '.escapeString('%'.$userName.'%') : '', |
|
400 | + !empty($email) ? 'AND users.email '.'LIKE '.escapeString('%'.$email.'%') : '', |
|
401 | + !empty($host) ? 'AND users.host '.'LIKE '.escapeString('%'.$host.'%') : '', |
|
402 | + (!empty($role) ? ('AND users.roles_id = '.$role) : ''), |
|
403 | 403 | $order[0], |
404 | 404 | $order[1], |
405 | 405 | ($start === false ? '' : ('LIMIT '.$offset.' OFFSET '.$start)) |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | |
512 | 512 | public static function isValidUrl($url): bool |
513 | 513 | { |
514 | - return (! preg_match('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i', $url)) ? false : true; |
|
514 | + return (!preg_match('/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i', $url)) ? false : true; |
|
515 | 515 | } |
516 | 516 | |
517 | 517 | /** |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | |
548 | 548 | // Make sure this is the last check, as if a further validation check failed, the invite would still have been used up. |
549 | 549 | $invitedBy = 0; |
550 | - if (! $forceInviteMode && (int) Settings::settingValue('..registerstatus') === Settings::REGISTER_STATUS_INVITE) { |
|
550 | + if (!$forceInviteMode && (int) Settings::settingValue('..registerstatus') === Settings::REGISTER_STATUS_INVITE) { |
|
551 | 551 | if ($inviteCode === '') { |
552 | 552 | return self::ERR_SIGNUP_BADINVITECODE; |
553 | 553 | } |
@@ -567,7 +567,7 @@ discard block |
||
567 | 567 | public static function checkAndUseInvite(string $inviteCode): int |
568 | 568 | { |
569 | 569 | $invite = Invitation::getInvite($inviteCode); |
570 | - if (! $invite) { |
|
570 | + if (!$invite) { |
|
571 | 571 | return -1; |
572 | 572 | } |
573 | 573 | |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | public static function add(string $userName, string $password, string $email, int $role, ?string $notes = '', string $host = '', int $invites = Invitation::DEFAULT_INVITES, int $invitedBy = 0) |
584 | 584 | { |
585 | 585 | $password = self::hashPassword($password); |
586 | - if (! $password) { |
|
586 | + if (!$password) { |
|
587 | 587 | return false; |
588 | 588 | } |
589 | 589 | |
@@ -625,9 +625,9 @@ discard block |
||
625 | 625 | |
626 | 626 | $cats = ['view console', 'view movies', 'view audio', 'view tv', 'view pc', 'view adult', 'view books', 'view other']; |
627 | 627 | |
628 | - if (! empty($allowed)) { |
|
628 | + if (!empty($allowed)) { |
|
629 | 629 | foreach ($cats as $cat) { |
630 | - if (! \in_array($cat, $allowed, false)) { |
|
630 | + if (!\in_array($cat, $allowed, false)) { |
|
631 | 631 | $ret[] = match ($cat) { |
632 | 632 | 'view console' => 1000, |
633 | 633 | 'view movies' => 2000, |