diff --git a/stubs/Exception.stub b/stubs/Exception.stub index a9f018bdeae..6b1ad09f878 100644 --- a/stubs/Exception.stub +++ b/stubs/Exception.stub @@ -52,6 +52,17 @@ interface Throwable class Exception implements Throwable { + /** @var string */ + protected $message; + + /** @var mixed */ + protected $code; + + /** @var string */ + protected $file; + + /** @var int */ + protected $line; /** * @return string @@ -99,6 +110,17 @@ class Exception implements Throwable class Error implements Throwable { + /** @var string */ + protected $message; + + /** @var mixed */ + protected $code; + + /** @var string */ + protected $file; + + /** @var int */ + protected $line; /** * @return string diff --git a/tests/PHPStan/Rules/Properties/OverridingPropertyRuleTest.php b/tests/PHPStan/Rules/Properties/OverridingPropertyRuleTest.php index dafac4e5f07..3f19d3859f5 100644 --- a/tests/PHPStan/Rules/Properties/OverridingPropertyRuleTest.php +++ b/tests/PHPStan/Rules/Properties/OverridingPropertyRuleTest.php @@ -171,4 +171,10 @@ public function testBug7692(): void $this->analyse([__DIR__ . '/data/bug-7692.php'], []); } + public function testBug11761(): void + { + $this->reportMaybes = true; + $this->analyse([__DIR__ . '/data/bug-11761.php'], []); + } + } diff --git a/tests/PHPStan/Rules/Properties/data/bug-11761.php b/tests/PHPStan/Rules/Properties/data/bug-11761.php new file mode 100644 index 00000000000..1d490d0934a --- /dev/null +++ b/tests/PHPStan/Rules/Properties/data/bug-11761.php @@ -0,0 +1,9 @@ +