mirror of
https://github.com/Respect/Validation.git
synced 2024-06-08 08:42:15 +02:00
Fix "IntVal" considering boolean values as valid
The commit54d17ab
tried to fix the that "IntVal" would pass with values that are not considered as an integer, but it does not change Even thought the commit54d17ab
fixes part of the wrong behaviour it left out the filter for boolean values. Co-authored-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
parent
54d17abcee
commit
f5ca4a298a
|
@ -15,7 +15,7 @@ class IntVal extends AbstractRule
|
|||
{
|
||||
public function validate($input)
|
||||
{
|
||||
if (is_float($input)) {
|
||||
if (is_float($input) || is_bool($input)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,6 +64,8 @@ class IntValTest extends \PHPUnit_Framework_TestCase
|
|||
['1.0'],
|
||||
[1.0],
|
||||
[' '],
|
||||
[true],
|
||||
[false],
|
||||
['Foo'],
|
||||
['1.44'],
|
||||
[1e-5],
|
||||
|
|
Loading…
Reference in a new issue