From ad7d140f5908ab025b9252d82b51430ecc38348f Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 4 Nov 2025 12:28:33 +0100 Subject: [PATCH 1/4] Increase mutation testing timeout --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ac667b45e2..8372725ccd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -240,6 +240,7 @@ jobs: run: | php build-infection/bin/infection-config.php \ --source-directory='build/PHPStan/Build' \ + --timeout=500 \ > infection.json5 cat infection.json5 | jq From 55d2d9e1817119738667b8cccc504774854beec3 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 4 Nov 2025 12:37:22 +0100 Subject: [PATCH 2/4] Add variable $x for additional processing --- src/Type/Php/ArrayMapFunctionReturnTypeExtension.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php b/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php index b58638dddf..85361ff9c1 100644 --- a/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php +++ b/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php @@ -41,6 +41,7 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection, if ($numArgs < 2) { return null; } + $x=1; $singleArrayArgument = !isset($functionCall->getArgs()[2]); $callback = $functionCall->getArgs()[0]->value; From ed712604c7032c8113ff0ff2df0ae8fbd6278bbe Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 4 Nov 2025 13:00:46 +0100 Subject: [PATCH 3/4] Update variable assignment for callable check Refactor variable assignment for callable type check. --- src/Type/Php/ArrayMapFunctionReturnTypeExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php b/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php index 85361ff9c1..4b981d3390 100644 --- a/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php +++ b/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php @@ -41,12 +41,12 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection, if ($numArgs < 2) { return null; } - $x=1; $singleArrayArgument = !isset($functionCall->getArgs()[2]); $callback = $functionCall->getArgs()[0]->value; $callableType = $scope->getType($callback); $callableIsNull = $callableType->isNull()->yes(); + $x=$callableType->isNull()->yes(); if ($callableType->isCallable()->yes()) { $valueType = $scope->getType(new FuncCall( From afd2b9c5462f918a3e2cb2f1f5b97ac75790ba47 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 4 Nov 2025 13:36:41 +0100 Subject: [PATCH 4/4] Discard changes to src/Type/Php/ArrayMapFunctionReturnTypeExtension.php --- src/Type/Php/ArrayMapFunctionReturnTypeExtension.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php b/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php index 4b981d3390..b58638dddf 100644 --- a/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php +++ b/src/Type/Php/ArrayMapFunctionReturnTypeExtension.php @@ -46,7 +46,6 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection, $callback = $functionCall->getArgs()[0]->value; $callableType = $scope->getType($callback); $callableIsNull = $callableType->isNull()->yes(); - $x=$callableType->isNull()->yes(); if ($callableType->isCallable()->yes()) { $valueType = $scope->getType(new FuncCall(