diff --git a/.claude/skills/regression-test/SKILL.md b/.claude/skills/regression-test/SKILL.md index 37090a8e95e..ed34dfd102d 100644 --- a/.claude/skills/regression-test/SKILL.md +++ b/.claude/skills/regression-test/SKILL.md @@ -49,7 +49,9 @@ Use when the bug is about **wrong inferred type, missing type narrowing, or inco Example (`tests/PHPStan/Analyser/nsrt/bug-12875.php`): ```php -= 8.0 += 8.0 + +declare(strict_types = 1); namespace Bug12875; diff --git a/.github/workflows/tests-levels-matrix.php b/.github/workflows/tests-levels-matrix.php index d5dbc90b82d..2a632308852 100644 --- a/.github/workflows/tests-levels-matrix.php +++ b/.github/workflows/tests-levels-matrix.php @@ -1,10 +1,19 @@ message; + } + + throw new RuntimeException('Error loading test-list.xml: ' . implode(', ', $errors)); } $testFilters = []; diff --git a/src/Testing/TypeInferenceTestCase.php b/src/Testing/TypeInferenceTestCase.php index 61c9bc01e32..b90da3b1c83 100644 --- a/src/Testing/TypeInferenceTestCase.php +++ b/src/Testing/TypeInferenceTestCase.php @@ -2,6 +2,7 @@ namespace PHPStan\Testing; +use LogicException; use PhpParser\Node; use PhpParser\Node\Expr\StaticCall; use PhpParser\Node\Name; @@ -44,6 +45,7 @@ use function is_string; use function preg_match; use function sprintf; +use function str_contains; use function str_starts_with; use function stripos; use function strtolower; @@ -432,8 +434,12 @@ public static function findTestDataFilesFromDirectory(string $directory): array $files = []; foreach ($finder->files()->name('*.php')->in($directory) as $fileInfo) { $path = $fileInfo->getPathname(); - if (self::isFileLintSkipped($path)) { - continue; + try { + if (self::isFileLintSkipped($path)) { + continue; + } + } catch (LogicException $e) { + self::fail($e->getMessage()); } $files[] = $path; } @@ -467,6 +473,8 @@ private static function isFileLintSkipped(string $file): bool if (preg_match('~= 8.1 += 8.1 + +declare(strict_types = 1); namespace Bug11472; diff --git a/tests/PHPStan/Analyser/nsrt/bug-12866.php b/tests/PHPStan/Analyser/nsrt/bug-12866.php index 4360d8bdd16..c686d8811a0 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-12866.php +++ b/tests/PHPStan/Analyser/nsrt/bug-12866.php @@ -1,4 +1,6 @@ -= 8.0 += 8.0 + +declare(strict_types = 1); namespace Bug12866; diff --git a/tests/PHPStan/Analyser/nsrt/bug-12875.php b/tests/PHPStan/Analyser/nsrt/bug-12875.php index bb4dc29c254..a88ae93ba84 100644 --- a/tests/PHPStan/Analyser/nsrt/bug-12875.php +++ b/tests/PHPStan/Analyser/nsrt/bug-12875.php @@ -1,4 +1,6 @@ -= 8.0 += 8.0 + +declare(strict_types = 1); namespace Bug12875a;