Motivation
The repo has no CS tooling at all — no .php-cs-fixer.dist.php, .phpcs.xml, rector.php, or .editorconfig — and drift is already visible: bin/aspect:4 uses declare(strict_types = 1) (spaces) while src/ consistently uses declare(strict_types=1). Notably, CI already installs cs2pr (.github/workflows/phpunit.yml:53) but nothing ever uses it.
Proposed change
- Add
friendsofphp/php-cs-fixer (dev dep) with a @PER-CS ruleset + declare_strict_types and risky rules kept minimal.
- Add
.editorconfig matching current conventions (4 spaces, LF, final newline).
- Add a CI
cs job running php-cs-fixer check --diff reported through cs2pr.
- One-off
php-cs-fixer fix commit, kept separate from the config commit for reviewability.
Acceptance criteria
composer cs / composer cs:fix (or documented equivalent) work locally; CI fails on style violations.
- The fix commit produces no behavioral diff (phpunit + PHPStan level 10 green).
Note: should land after the other open modernization PRs to avoid repo-wide formatting conflicts.
Motivation
The repo has no CS tooling at all — no
.php-cs-fixer.dist.php,.phpcs.xml,rector.php, or.editorconfig— and drift is already visible:bin/aspect:4usesdeclare(strict_types = 1)(spaces) whilesrc/consistently usesdeclare(strict_types=1). Notably, CI already installscs2pr(.github/workflows/phpunit.yml:53) but nothing ever uses it.Proposed change
friendsofphp/php-cs-fixer(dev dep) with a@PER-CSruleset +declare_strict_typesand risky rules kept minimal..editorconfigmatching current conventions (4 spaces, LF, final newline).csjob runningphp-cs-fixer check --diffreported throughcs2pr.php-cs-fixer fixcommit, kept separate from the config commit for reviewability.Acceptance criteria
composer cs/composer cs:fix(or documented equivalent) work locally; CI fails on style violations.Note: should land after the other open modernization PRs to avoid repo-wide formatting conflicts.