From b79a8e84342bd5c3670f0d57813cbf30705115b5 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sun, 30 Aug 2026 11:33:08 +0200 Subject: [PATCH] Fix numeric widening at two call sites --- src/Rules/Functions/PrintfHelper.php | 2 +- src/Type/Php/ArrayMapFunctionReturnTypeExtension.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Rules/Functions/PrintfHelper.php b/src/Rules/Functions/PrintfHelper.php index 3572a7b32cd..1f5d2a9fb3a 100644 --- a/src/Rules/Functions/PrintfHelper.php +++ b/src/Rules/Functions/PrintfHelper.php @@ -111,7 +111,7 @@ private function parsePlaceholders(string $specifiersPattern, string $format): ? $parsedPlaceholders[] = new PrintfPlaceholder( sprintf('"%s"', $placeholder[0]) . ($showValueSuffix ? ' (value)' : ''), isset($placeholder['position']) && $placeholder['position'] !== '' - ? $placeholder['position'] - 1 + ? (int) $placeholder['position'] - 1 : $parameterIdx++, $placeholderNumber, $this->getAcceptingTypeBySpecifier($specifier), diff --git a/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php b/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php index a9766d7ceba..9ae5442fb17 100644 --- a/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php +++ b/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php @@ -62,6 +62,7 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection, )); } elseif ($callableIsNull) { $arrayBuilder = ConstantArrayTypeBuilder::createEmpty(); + /** @var array $argTypes */ $argTypes = []; $areAllSameSize = true; $expectedSize = null;