From ae15b316560c97943ec173f513812a77dedc32a0 Mon Sep 17 00:00:00 2001 From: Vincent Langlet Date: Tue, 29 Jul 2025 14:20:21 +0200 Subject: [PATCH] Add non regression test for 13267 --- .../Rules/Methods/CallMethodsRuleTest.php | 10 ++++++++++ tests/PHPStan/Rules/Methods/data/bug-13267.php | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 tests/PHPStan/Rules/Methods/data/bug-13267.php diff --git a/tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php b/tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php index 0a78d5dfd5..944ef5ebc1 100644 --- a/tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php +++ b/tests/PHPStan/Rules/Methods/CallMethodsRuleTest.php @@ -3646,6 +3646,16 @@ public function testBug5642(): void ]); } + public function testBug13267(): void + { + $this->checkThisOnly = false; + $this->checkNullables = false; + $this->checkUnionTypes = true; + $this->checkExplicitMixed = false; + + $this->analyse([__DIR__ . '/data/bug-13267.php'], []); + } + public function testBug3396(): void { $this->checkThisOnly = false; diff --git a/tests/PHPStan/Rules/Methods/data/bug-13267.php b/tests/PHPStan/Rules/Methods/data/bug-13267.php new file mode 100644 index 0000000000..f49948300e --- /dev/null +++ b/tests/PHPStan/Rules/Methods/data/bug-13267.php @@ -0,0 +1,16 @@ +getMessage(), + $e->getCode(), + 1, + $e->getFile(), + $e->getLine(), + $e->getPrevious(), + ); + } +}