Skip to content

Commit

Permalink
Update PasswordInputHelper.php
Browse files Browse the repository at this point in the history
Type error fix for PHP <8.2
  • Loading branch information
eluhr authored Dec 7, 2023
1 parent ce539ab commit 71d605e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helpers/PasswordInputHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ class PasswordInputHelper
* @param string $pattern
* @return bool
*/
public static function patternMatches($text, string $pattern): bool
public static function patternMatches(?string $text, string $pattern): bool
{
$index = md5($pattern . $text);
if (!isset(self::$_matches[$index])) {
self::$_matches[$index] = preg_match($pattern, $text) === 1;
self::$_matches[$index] = preg_match($pattern, (string)$text) === 1;
}
return self::$_matches[$index];
}
Expand Down

0 comments on commit 71d605e

Please sign in to comment.