diff --git a/tests/PHPStan/Rules/Properties/MissingPropertyTypehintRuleTest.php b/tests/PHPStan/Rules/Properties/MissingPropertyTypehintRuleTest.php index e17100bc38..c274aff53c 100644 --- a/tests/PHPStan/Rules/Properties/MissingPropertyTypehintRuleTest.php +++ b/tests/PHPStan/Rules/Properties/MissingPropertyTypehintRuleTest.php @@ -66,6 +66,11 @@ public function testBug3402(): void $this->analyse([__DIR__ . '/data/bug-3402.php'], []); } + public function testBug11761(): void + { + $this->analyse([__DIR__ . '/data/bug-11761-bis.php'], []); + } + public function testPromotedProperties(): void { $this->analyse([__DIR__ . '/data/promoted-properties-missing-typehint.php'], []); diff --git a/tests/PHPStan/Rules/Properties/OverridingPropertyRuleTest.php b/tests/PHPStan/Rules/Properties/OverridingPropertyRuleTest.php index 1384576b1d..91fed911ba 100644 --- a/tests/PHPStan/Rules/Properties/OverridingPropertyRuleTest.php +++ b/tests/PHPStan/Rules/Properties/OverridingPropertyRuleTest.php @@ -265,6 +265,12 @@ public function testBug12466(): void ]); } + public function testBug11761(): void + { + $this->reportMaybes = true; + $this->analyse([__DIR__ . '/data/bug-11761.php'], []); + } + #[RequiresPhp('>= 8.4')] public function testBug12586(): void { diff --git a/tests/PHPStan/Rules/Properties/data/bug-11761-bis.php b/tests/PHPStan/Rules/Properties/data/bug-11761-bis.php new file mode 100644 index 0000000000..f1714403f5 --- /dev/null +++ b/tests/PHPStan/Rules/Properties/data/bug-11761-bis.php @@ -0,0 +1,8 @@ +