Skip to content

Commit

Permalink
Fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Jan 2, 2023
1 parent 0d875e6 commit bab5bf0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Reflection/InitializerExprTypeResolver.php
Expand Up @@ -74,8 +74,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 @@ -1690,14 +1692,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 @@ -1710,14 +1712,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 bab5bf0

Please sign in to comment.