From fd25c2779ca7fd4decee7038282ab9743b16d167 Mon Sep 17 00:00:00 2001 From: Ondrej Mirtes Date: Tue, 10 Sep 2024 11:48:05 +0200 Subject: [PATCH] Fix false positive when extending SplObjectStorage on PHP < 8.4 --- .../Rules/Methods/MissingMethodImplementationRuleTest.php | 5 +++++ tests/PHPStan/Rules/Methods/data/bug-11665.php | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 tests/PHPStan/Rules/Methods/data/bug-11665.php diff --git a/tests/PHPStan/Rules/Methods/MissingMethodImplementationRuleTest.php b/tests/PHPStan/Rules/Methods/MissingMethodImplementationRuleTest.php index 10615f2928..82240f467e 100644 --- a/tests/PHPStan/Rules/Methods/MissingMethodImplementationRuleTest.php +++ b/tests/PHPStan/Rules/Methods/MissingMethodImplementationRuleTest.php @@ -59,4 +59,9 @@ public function testEnums(): void ]); } + public function testBug11665(): void + { + $this->analyse([__DIR__ . '/data/bug-11665.php'], []); + } + } diff --git a/tests/PHPStan/Rules/Methods/data/bug-11665.php b/tests/PHPStan/Rules/Methods/data/bug-11665.php new file mode 100644 index 0000000000..1926a10ac5 --- /dev/null +++ b/tests/PHPStan/Rules/Methods/data/bug-11665.php @@ -0,0 +1,7 @@ +