-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistency between Assert::alpha and Assert::alnum #197
Comments
/cc @Ocramius |
IMO, changing these would be a BC break: it's worth doing it in a 2.0, but
otherwise leave the inconsistency there and we keep the issue
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/
…On Sat, May 30, 2020 at 2:41 AM Ivan Kurnosov ***@***.***> wrote:
/cc @Ocramius <https://github.com/Ocramius>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#197 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABFVECGTUG7DO2RG3XGH6DRUBI2FANCNFSM4NOORCRA>
.
|
Indeed, would be helpful if milestone was added here then. |
ctype is funny in that it just returns false if the entered value is not a string. Even an object that could be cast to a string is not. So the end result should be the same (except for integers between -128 and 255) |
Yep, but isn't the general idea behind assertion libraries (in general) is: we pass you any arbitrary rubbish and if it's not what we expect - throw. As of now - if you want to check it's an |
The documentation states
But then implementations are:
Note that
alpha
acceptsmixed
and checks if it's a string explicitly, butalnum
expects it's a string already and does not make a runtime check.I think both documentation and implementation should be changed to be consistent.
The text was updated successfully, but these errors were encountered: