-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Update Range.rst #10918
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
Update Range.rst #10918
Conversation
I think that `int` is kind of misleading here as any `is_numeric` value evaluated to `true` is accepted (other than strings). https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/Constraints/RangeValidator.php#L36 I've done this PR for 3.4 but I think it should be reported to all next versions as well.
I think this proposed change is correct because the code literally checks for numeric values, not only integers: https://github.com/symfony/symfony/blob/aca3d2c90d3ad01687771ce75602fed5b12bcf2b/src/Symfony/Component/Validator/Constraints/RangeValidator.php#L36 |
@@ -320,15 +320,15 @@ Options | |||
min | |||
~~~ | |||
|
|||
**type**: ``int`` or ``string`` (date format) | |||
**type**: ``numeric`` or ``string`` (date format) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should call it number
IMHO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was doubtful indeed. Is true that number
is better but numeric
gives the reader back additional infos somehow. Don't know if number
(same for numeric
of course) is used elsewhere in docs. Whe should try adopt that standard (if any)
This PR was merged into the 3.4 branch. Discussion ---------- Update Range.rst I think that `int` is kind of misleading here as any `is_numeric` value evaluated to `true` is accepted (other than strings). https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/Constraints/RangeValidator.php#L36 I've done this PR for 3.4 but I think it should be reported to all next versions as well. Commits ------- ddeea95 Update Range.rst
@DonCallisto thanks for this! I couldn't find other occurrences of "number" or "numeric", so I changed it to "number" while merging, because I think it sounds better. |
Ok, cheers 🍻 😄 |
I think that
int
is kind of misleading here as anyis_numeric
value evaluated totrue
is accepted (other than strings).https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Validator/Constraints/RangeValidator.php#L36
I've done this PR for 3.4 but I think it should be reported to all next versions as well.