Skip to content

Commit

Permalink
allow null in typehint
Browse files Browse the repository at this point in the history
  • Loading branch information
briskt committed Jun 9, 2024
1 parent 0a1cdfd commit 2c9a87d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/silauth/lib/Auth/Source/auth/Authenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ protected function isBlockedByRateLimit(string $username, array $ipAddresses): b
FailedLoginIpAddress::isRateLimitBlockingAnyOfThese($ipAddresses);
}

public static function isCaptchaRequired(string $username, array $ipAddresses): bool
public static function isCaptchaRequired(?string $username, array $ipAddresses): bool
{
return FailedLoginUsername::isCaptchaRequiredFor($username) ||
FailedLoginIpAddress::isCaptchaRequiredForAnyOfThese($ipAddresses);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public static function isRateLimitBlocking(string $username): bool
return ($secondsUntilUnblocked > 0);
}

public static function isCaptchaRequiredFor(string $username): bool
public static function isCaptchaRequiredFor(?string $username): bool
{
if (empty($username)) {
return false;
Expand Down

0 comments on commit 2c9a87d

Please sign in to comment.