From fc86e571671dc6cb80b3c4eb923eb98e14d12405 Mon Sep 17 00:00:00 2001 From: schlndh Date: Sat, 27 Sep 2025 18:41:21 +0200 Subject: [PATCH] use string instead of __stringandstringable in printf parameter error message --- src/Rules/Functions/PrintfParameterTypeRule.php | 4 ++-- tests/PHPStan/Rules/Functions/PrintfParameterTypeRuleTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Rules/Functions/PrintfParameterTypeRule.php b/src/Rules/Functions/PrintfParameterTypeRule.php index 3c83e765b9..d91da4590e 100644 --- a/src/Rules/Functions/PrintfParameterTypeRule.php +++ b/src/Rules/Functions/PrintfParameterTypeRule.php @@ -106,8 +106,8 @@ public function processNode(Node $node, Scope $scope): array 'strict-int' => 'int', 'int' => 'int', 'float' => 'float', - 'string' => '__stringandstringable', - 'mixed' => '__stringandstringable', + 'string' => 'string', + 'mixed' => 'string', ] : [ 'strict-int' => 'int', diff --git a/tests/PHPStan/Rules/Functions/PrintfParameterTypeRuleTest.php b/tests/PHPStan/Rules/Functions/PrintfParameterTypeRuleTest.php index c945ff723f..06e34b998c 100644 --- a/tests/PHPStan/Rules/Functions/PrintfParameterTypeRuleTest.php +++ b/tests/PHPStan/Rules/Functions/PrintfParameterTypeRuleTest.php @@ -239,11 +239,11 @@ public function testStrict(): void 45, ], [ - 'Parameter #2 of function printf is expected to be __stringandstringable by placeholder #1 ("%s"), null given.', + 'Parameter #2 of function printf is expected to be string by placeholder #1 ("%s"), null given.', 47, ], [ - 'Parameter #2 of function printf is expected to be __stringandstringable by placeholder #1 ("%s"), true given.', + 'Parameter #2 of function printf is expected to be string by placeholder #1 ("%s"), true given.', 48, ], ]);