From 88b6848f7df1018417838d1976ef018373b0f4e3 Mon Sep 17 00:00:00 2001 From: Sander Muller Date: Fri, 7 Aug 2026 11:57:47 +0200 Subject: [PATCH] Accept the shared data provider's third argument in testOverridingFinalMethod dataOverridingFinalMethod() yields three values per set and is shared with testParle(), which uses all three. testOverridingFinalMethod() declared only two parameters, so PHPUnit 12 errors with "data set has more arguments (3) than the test method accepts (2)". Older PHPUnit tolerated the extra value, which is why it surfaced only once the PHPUnit 12 matrix picked up a stricter release. Declare the third parameter to match the provider; the method has no covariance assertion, so the value is unused there. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/PHPStan/Rules/Methods/OverridingMethodRuleTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/PHPStan/Rules/Methods/OverridingMethodRuleTest.php b/tests/PHPStan/Rules/Methods/OverridingMethodRuleTest.php index 366c39b996..f5068574bf 100644 --- a/tests/PHPStan/Rules/Methods/OverridingMethodRuleTest.php +++ b/tests/PHPStan/Rules/Methods/OverridingMethodRuleTest.php @@ -56,7 +56,7 @@ public static function dataOverridingFinalMethod(): array } #[DataProvider('dataOverridingFinalMethod')] - public function testOverridingFinalMethod(int $phpVersion, string $contravariantMessage): void + public function testOverridingFinalMethod(int $phpVersion, string $contravariantMessage, string $covariantMessage): void { $errors = [ [