Skip to content

Commit 143a1c6

Browse files
shiomachiShioPy0101
authored andcommitted
fix
1 parent 9ab5547 commit 143a1c6

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

‎src/Type/Php/RoundFunctionReturnTypeExtension.php‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
use PHPStan\Type\StringType;
2323
use PHPStan\Type\Type;
2424
use PHPStan\Type\TypeCombinator;
25-
use function array_map;
25+
use PHPStan\Type\UnionType;
2626
use function ceil;
2727
use function count;
2828
use function floor;
@@ -88,14 +88,6 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection,
8888
}
8989

9090
if ($this->phpVersion->hasStricterRoundFunctions()) {
91-
<<<<<<< HEAD
92-
=======
93-
$allowed = TypeCombinator::union(
94-
new IntegerType(),
95-
new FloatType(),
96-
);
97-
98-
>>>>>>> 05dc61fe1 (fix style)
9991
if (!$scope->isDeclareStrictTypes()) {
10092
$allowed = new UnionType([
10193
new IntegerType(),
@@ -118,7 +110,6 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection,
118110
// PHP 8 fatals if the parameter is not an integer or float.
119111
return new NeverType(true);
120112
}
121-
122113
} elseif ($firstArgType->isArray()->yes()) {
123114
// PHP 7 returns false if the parameter is an array.
124115
return new ConstantBooleanType(false);
@@ -185,7 +176,7 @@ public function resolveConstantType(string $functionName, array $args, Scope $sc
185176
}
186177

187178
if (count($returnValueTypes) >= 1) {
188-
return TypeCombinator::union(...array_map(static fn ($l) => $l, $returnValueTypes));
179+
return TypeCombinator::union(...$returnValueTypes);
189180
}
190181

191182
return null;

0 commit comments

Comments
 (0)