Skip to content

Commit 7ec9fbd

Browse files
committed
Don't cast floats to booleans.
1 parent ee22720 commit 7ec9fbd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Cast.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,12 @@ public static function toManBool($value, ?bool $default = null): bool
222222
return $default;
223223
}
224224

225-
if ($value===true || $value===1 || $value==='1' || $value===1.0)
225+
if ($value===true || $value===1 || $value==='1')
226226
{
227227
return true;
228228
}
229229

230-
if ($value===false || $value===0 || $value==='0' || $value===0.0)
230+
if ($value===false || $value===0 || $value==='0')
231231
{
232232
return false;
233233
}

0 commit comments

Comments
 (0)