From f17d94da974358abda4710b997ceb9f066dd9bef Mon Sep 17 00:00:00 2001 From: Jan Nedbal Date: Tue, 5 Aug 2025 16:14:38 +0200 Subject: [PATCH] Trait error ignored with used class path fails with partial analysis --- tests/PHPStan/Analyser/AnalyserTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/PHPStan/Analyser/AnalyserTest.php b/tests/PHPStan/Analyser/AnalyserTest.php index 297d612c8d..2eef38d74a 100644 --- a/tests/PHPStan/Analyser/AnalyserTest.php +++ b/tests/PHPStan/Analyser/AnalyserTest.php @@ -467,6 +467,21 @@ public function testIgnoreErrorInTraitUsingClassFilePath(string $pathToIgnore): $this->assertNoErrors($result); } + #[DataProvider('dataIgnoreErrorInTraitUsingClassFilePath')] + public function testIgnoreErrorInTraitUsingClassFilePathWithPartialAnalysis(string $pathToIgnore): void + { + $ignoreErrors = [ + [ + 'message' => '#Fail\.#', + 'path' => $pathToIgnore, + ], + ]; + $result = $this->runAnalyser($ignoreErrors, true, [ + __DIR__ . '/data/traits-ignore/Foo.php', + ], true); + $this->assertNoErrors($result); + } + public function testIgnoredErrorMissingMessage(): void { $ignoreErrors = [