Closed froschdesign closed 12 months ago
The following code throws an AssertionError:
AssertionError
$validator = new Laminas\I18n\Validator\IsFloat(); var_dump($validator->isValid(''));
Fatal error: Uncaught AssertionError: assert($lastStringGroup !== '') in /src/Validator/IsFloat.php:242
https://github.com/laminas/laminas-i18n/blob/4f23433e415b14c4d66a7d7d1983c5890ac9ed2a/src/Validator/IsFloat.php#L233-L242
These lines were introduced with #104: https://github.com/laminas/laminas-i18n/pull/104/commits/5062ef1b6e725eb2a05c56759ac241c1ef776cf2
In previous versions this was not a problem:
$validator = new Laminas\I18n\Validator\IsFloat(); var_dump($validator->isValid('')); // false var_dump($validator->getMessages()); ['notFloat' => 'The input does not appear to be a float']
@froschdesign Look good to you? I can't request your review because you opened the patch!
@gsteel Thank you for your help! 👍🏻
Description
The following code throws an
AssertionError
:https://github.com/laminas/laminas-i18n/blob/4f23433e415b14c4d66a7d7d1983c5890ac9ed2a/src/Validator/IsFloat.php#L233-L242
These lines were introduced with #104: https://github.com/laminas/laminas-i18n/pull/104/commits/5062ef1b6e725eb2a05c56759ac241c1ef776cf2
In previous versions this was not a problem: