Fix "IntVal" considering boolean values as valid

The commit 54d17ab 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 commit 54d17ab 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:
Adam Benson 2018-06-27 22:48:49 +10:00 committed by Henrique Moody
parent 54d17abcee
commit f5ca4a298a
No known key found for this signature in database
GPG key ID: 221E9281655813A6
2 changed files with 3 additions and 1 deletions

View file

@ -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;
}

View file

@ -64,6 +64,8 @@ class IntValTest extends \PHPUnit_Framework_TestCase
['1.0'],
[1.0],
[' '],
[true],
[false],
['Foo'],
['1.44'],
[1e-5],