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
Version 3.0 #1
Version 3.0 #1
Conversation
src/Filter/UnsignedInt.php
Outdated
* @throws \InvalidArgumentException if minvalue is not greater or equal to zero. | ||
* @throws FilterException on failure to filter. | ||
*/ | ||
public static function filter($value, bool $allowNull = false, int $minValue = null, int $maxValue = PHP_INT_MAX) |
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.
default $minValue
to 0
instead of 'null
src/Filter/UnsignedInt.php
Outdated
*/ | ||
public static function filter($value, bool $allowNull = false, int $minValue = null, int $maxValue = PHP_INT_MAX) | ||
{ | ||
if ($minValue === null) { |
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.
If you default $minValue
to 0
, this check can be removed
src/Filter/UnsignedInt.php
Outdated
{ | ||
if ($minValue === null) { | ||
$minValue = 0; | ||
} elseif (is_int($minValue) && $minValue < 0) { |
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.
you can remove the is_int
check
No description provided.