Skip to content

Commit

Permalink
Fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Nov 19, 2022
1 parent 5551205 commit 6b93857
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Reflection/InitializerExprTypeResolver.php
Expand Up @@ -71,8 +71,10 @@
use function is_float;
use function is_int;
use function max;
use function min;
use function sprintf;
use function strtolower;
use const INF;

class InitializerExprTypeResolver
{
Expand Down Expand Up @@ -1669,14 +1671,14 @@ private function integerRangeMath(Type $range, BinaryOp $node, Type $operand): T

$result = TypeCombinator::union(
$this->integerRangeMath($range, $node, $negativeOperand),
$this->integerRangeMath($range, $node, $positiveOperand)
$this->integerRangeMath($range, $node, $positiveOperand),
)->toNumber();

if ($result->equals(new UnionType([new IntegerType(), new FloatType()]))) {
return new BenevolentUnionType([new IntegerType(), new FloatType()]);
} else {
return $result;
}

return $result;
}
if (
($rangeMin < 0 || $rangeMin === null)
Expand All @@ -1689,14 +1691,14 @@ private function integerRangeMath(Type $range, BinaryOp $node, Type $operand): T

$result = TypeCombinator::union(
$this->integerRangeMath($negativeRange, $node, $operand),
$this->integerRangeMath($positiveRange, $node, $operand)
$this->integerRangeMath($positiveRange, $node, $operand),
)->toNumber();

if ($result->equals(new UnionType([new IntegerType(), new FloatType()]))) {
return new BenevolentUnionType([new IntegerType(), new FloatType()]);
} else {
return $result;
}

return $result;
}

$rangeMinSign = ($rangeMin ?? -INF) <=> 0;
Expand Down

0 comments on commit 6b93857

Please sign in to comment.