From 4fb1642af75b24bf41cc94853e1f66426ed5a16a Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 17 Nov 2025 10:50:35 +0100 Subject: [PATCH 1/2] fix cs --- tests/PHPStan/Analyser/Bug13813IntegrationTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/PHPStan/Analyser/Bug13813IntegrationTest.php b/tests/PHPStan/Analyser/Bug13813IntegrationTest.php index 943a17c084..667db7ecd2 100644 --- a/tests/PHPStan/Analyser/Bug13813IntegrationTest.php +++ b/tests/PHPStan/Analyser/Bug13813IntegrationTest.php @@ -26,11 +26,11 @@ public function testBug13813(): void $this->assertSame( 'Warning: Undefined variable $x', - $analyzerResult->getAllPhpErrors()[0]->getMessage() + $analyzerResult->getAllPhpErrors()[0]->getMessage(), ); $this->assertSame( 'Warning: Undefined variable $x', - $analyzerResult->getAllPhpErrors()[1]->getMessage() + $analyzerResult->getAllPhpErrors()[1]->getMessage(), ); } From c9beede9ef7f2aa927f46f44f0eb62f47626251e Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 17 Nov 2025 11:04:33 +0100 Subject: [PATCH 2/2] fix php 7.4 --- .../Analyser/Bug13813IntegrationTest.php | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/tests/PHPStan/Analyser/Bug13813IntegrationTest.php b/tests/PHPStan/Analyser/Bug13813IntegrationTest.php index 667db7ecd2..06fe8f64ae 100644 --- a/tests/PHPStan/Analyser/Bug13813IntegrationTest.php +++ b/tests/PHPStan/Analyser/Bug13813IntegrationTest.php @@ -24,14 +24,25 @@ public function testBug13813(): void $this->assertCount(2, $analyzerResult->getAllPhpErrors()); $this->assertCount(2, $analyzerResult->getFilteredPhpErrors()); - $this->assertSame( - 'Warning: Undefined variable $x', - $analyzerResult->getAllPhpErrors()[0]->getMessage(), - ); - $this->assertSame( - 'Warning: Undefined variable $x', - $analyzerResult->getAllPhpErrors()[1]->getMessage(), - ); + if (PHP_VERSION_ID >= 80000) { + $this->assertSame( + 'Warning: Undefined variable $x', + $analyzerResult->getAllPhpErrors()[0]->getMessage(), + ); + $this->assertSame( + 'Warning: Undefined variable $x', + $analyzerResult->getAllPhpErrors()[1]->getMessage(), + ); + } else { + $this->assertSame( + 'Notice: Undefined variable $x', + $analyzerResult->getAllPhpErrors()[0]->getMessage(), + ); + $this->assertSame( + 'Notice: Undefined variable $x', + $analyzerResult->getAllPhpErrors()[1]->getMessage(), + ); + } } /**