From e6e6a98a08a56d074d2fa0431ca41c6ab1a5d4fa Mon Sep 17 00:00:00 2001 From: tajimayuki Date: Mon, 24 Nov 2025 16:21:10 +0900 Subject: [PATCH] chore: add regression test for bug-10942 --- .../Analyser/AnalyserIntegrationTest.php | 6 +++++ tests/PHPStan/Analyser/nsrt/bug-10942.php | 27 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 tests/PHPStan/Analyser/nsrt/bug-10942.php diff --git a/tests/PHPStan/Analyser/AnalyserIntegrationTest.php b/tests/PHPStan/Analyser/AnalyserIntegrationTest.php index 9ffbc19566..7c8e3aa95a 100644 --- a/tests/PHPStan/Analyser/AnalyserIntegrationTest.php +++ b/tests/PHPStan/Analyser/AnalyserIntegrationTest.php @@ -1577,6 +1577,12 @@ public function testBug13714(): void $this->assertSame('Function Bug13714\array_find invoked with 2 parameters, 0 required.', $errors[6]->getMessage()); } + public function testBug10942(): void + { + $errors = $this->runAnalyse(__DIR__ . '/nsrt/bug-10942.php'); + $this->assertNoErrors($errors); + } + /** * @param string[]|null $allAnalysedFiles * @return list diff --git a/tests/PHPStan/Analyser/nsrt/bug-10942.php b/tests/PHPStan/Analyser/nsrt/bug-10942.php new file mode 100644 index 0000000000..d4a6d5824f --- /dev/null +++ b/tests/PHPStan/Analyser/nsrt/bug-10942.php @@ -0,0 +1,27 @@ +