Skip to content

Commit

Permalink
fix: fix a bug with a target_callbacl second argument as boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristoforo Cervino committed May 28, 2024
1 parent 8455670 commit 8994efe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Assert.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ protected static function isCompatibleWithType(string $type, $value): bool
return \get_class($value) === $type || \is_subclass_of($value, $type);
}

return \gettype($value) === $type;
$gettype = \gettype($value);
if ($gettype === 'boolean') {
$gettype = 'bool';
}

return $gettype === $type;
}
}

0 comments on commit 8994efe

Please sign in to comment.