Skip to content

Commit

Permalink
Changing the count check in Validation::count()
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Krämer committed Apr 27, 2016
1 parent e61f21d commit 92e6f56
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Validation/Validation.php
Expand Up @@ -229,6 +229,7 @@ public static function cc($check, $type = 'fast', $deep = false, $regex = null)
*/
public static function count($check1, $operator, $expectedCount)
{
$count = null;
if (is_array($check1) || $check1 instanceof \Countable) {
$count = count($check1);
} elseif (is_string($check1)) {
Expand All @@ -237,7 +238,7 @@ public static function count($check1, $operator, $expectedCount)
$count = $check1;
}

if (!isset($count)) {
if ($count === null) {
return false;
}

Expand Down

0 comments on commit 92e6f56

Please sign in to comment.