Skip to content

Commit f590c1d

Browse files
Be strict about null in the validator
1 parent 9159290 commit f590c1d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Validator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function notEmpty()
5959
{
6060
return $this->assertCallback(
6161
function ($value) {
62-
return strlen(trim($value)) > 0;
62+
return $value !== null && strlen(trim($value)) > 0;
6363
},
6464
'is empty'
6565
);
@@ -76,7 +76,7 @@ public function isInteger()
7676
{
7777
return $this->assertCallback(
7878
function ($value) {
79-
return ctype_digit($value);
79+
return $value !== null && ctype_digit($value);
8080
},
8181
'is not an integer'
8282
);
@@ -93,7 +93,7 @@ public function isBoolean()
9393
{
9494
return $this->assertCallback(
9595
function ($value) {
96-
if ($value === '') {
96+
if ($value === null || $value === '') {
9797
return false;
9898
}
9999

0 commit comments

Comments
 (0)