Skip to content

Commit bfa5f28

Browse files
LTSCommerceclaude
andcommitted
fix(psr4): ship php_cs_finder.php in the default ignore list
qaConfig/php_cs_finder.php is the documented CS Fixer Finder override (docs/coding-standards.md tells projects to copy it into qaConfig/), yet the shipped psr4-validate ignore list exempted only phparkitect.php and php_cs.php - so any project following that doc failed the PSR-4 gate with a false "Parse Error" on the classless finder file. Surfaced by ballicom-zoho's full pipeline run on 2026-08-28. TDD: the projectQaConfig fixture gains a php_cs_finder.php, which turns testShippedDefaultIgnoreListExcludesQaConfigConfigFiles red on the old list; the new ignore entry makes it green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent bd40882 commit bfa5f28

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

configDefaults/generic/psr4-validate-ignore-list.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
#tests/Asset#
44
#qaConfig/phparkitect\.php#
55
#qaConfig/php_cs\.php#
6+
#qaConfig/php_cs_finder\.php#

tests/Small/Psr4ValidatorTest.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,12 @@ public function testItFindsErrorsAndThrowsAnExceptionOnAnInvalidProject(): void
114114
/**
115115
* Regression: php-qa-ci's own convention maps `qaConfig/` as a PSR-4 root
116116
* (QaConfig\, for custom PHPStan rules) AND ships non-class config files
117-
* there that projects override — qaConfig/phparkitect.php and
118-
* qaConfig/php_cs.php. Those legitimately have no namespace, so the SHIPPED
119-
* default ignore list must exclude them; otherwise the re-enabled PSR-4
120-
* gate falsely reports them as Parse Errors on every consuming project.
117+
* there that projects override — qaConfig/phparkitect.php,
118+
* qaConfig/php_cs.php and qaConfig/php_cs_finder.php (the documented CS
119+
* Fixer Finder override, docs/coding-standards.md). Those legitimately
120+
* have no namespace, so the SHIPPED default ignore list must exclude them;
121+
* otherwise the re-enabled PSR-4 gate falsely reports them as Parse Errors
122+
* on every consuming project.
121123
*
122124
* The fixture also contains a correctly-namespaced rule class under the
123125
* same root (qaConfig/PHPStan/Rules/GoodRule.php) to prove the exclusion is
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* Fixture mirroring a real project's qaConfig/php_cs_finder.php override (the
7+
* documented CS Fixer Finder override — see docs/coding-standards.md): another
8+
* non-class config file with NO namespace under the `QaConfig\` PSR-4 root.
9+
*/
10+
11+
return ['fixture' => true];

0 commit comments

Comments
 (0)