From a376058f46413f476da56977481a8ad6e0e5dfba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Sat, 30 Sep 2023 14:29:03 +0200 Subject: [PATCH] Drop wrong comparison using PHP_FLOAT_EPSILON --- src/Type/Php/FilterFunctionReturnTypeHelper.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Type/Php/FilterFunctionReturnTypeHelper.php b/src/Type/Php/FilterFunctionReturnTypeHelper.php index 7ae801bfd92..17ba5ade7b8 100644 --- a/src/Type/Php/FilterFunctionReturnTypeHelper.php +++ b/src/Type/Php/FilterFunctionReturnTypeHelper.php @@ -32,7 +32,6 @@ use function octdec; use function preg_match; use function sprintf; -use const PHP_FLOAT_EPSILON; final class FilterFunctionReturnTypeHelper { @@ -293,7 +292,7 @@ private function determineExactType(Type $in, int $filterValue, Type $defaultTyp } if ($in instanceof ConstantFloatType) { - return $in->getValue() - (int) $in->getValue() <= PHP_FLOAT_EPSILON + return $in->getValue() - (int) $in->getValue() === 0.0 ? $in->toInteger() : $defaultType; }