Skip to content

Use shared PHP-CS-Fixer configuration - #29

Merged
donatj merged 4 commits into
masterfrom
chore/shared-php-cs-fixer
Nov 3, 2026
Merged

donatj merged 4 commits into
masterfrom
chore/shared-php-cs-fixer

Conversation

@donatj

@donatj donatj commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

The project maintains a separate copy of its PHP-CS-Fixer rules. The continuous integration checks do not run the fixer.

Use the shared PHP 7.4 preset. Keep the existing source scope and the project's return-type spacing. Preserve the PHPUnit migration and visibility rules. Apply the resulting source changes. Run the fixer in dry-run mode as part of make test.

Bump PHP-CS-Fixer and allow it to run on PHP 8.6 through its configuration. Enable Composer package sorting and sort the dependency lists.

Validation: composer validate --no-check-publish and make test on PHP 8.5. The fixer dry run is clean. All eight tests pass.

@donatj
donatj marked this pull request as ready for review November 3, 2026 09:43
Copilot AI balanced review requested due to automatic review settings November 3, 2026 09:43
@donatj
donatj merged commit bdc191d into master Nov 3, 2026
17 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the shared PHP-CS-Fixer preset and formatting-check changes.

No open issues 🎉

What changed in this PR

Replaces the project’s duplicated PHP-CS-Fixer rules with the shared PHP 7.4 preset and adds formatting checks to make test.

Changes:

  • Adopts the shared preset while retaining project-specific return-type spacing, PHPUnit migration, visibility rules, and source scope.
  • Updates PHP-CS-Fixer, permits unsupported PHP versions through configuration, and enables Composer package sorting.
  • Applies the resulting formatting changes and adds a fixer dry run to the existing style checks.
File Description
src/​Corpus/​Sniffs/​TestCase.php Simplifies equivalent backslash escaping in the fixture assertion.
src/​Corpus/​Sniffs/​Methods/​MethodParameterFormattingSniff.php Adds trailing commas to multiline calls.
src/​Corpus/​Sniffs/​General/​ReturnTrailingNewlineSniff.php Adds a trailing comma to a multiline call.
src/​Corpus/​Sniffs/​General/​BinaryOperationNewlineSniff.php Adds a trailing comma to a multiline call.
src/​Corpus/​Sniffs/​ControlStructures/​OpeningOneTrueBraceSniff.php Adds a trailing comma to a multiline call.
src/​Corpus/​Sniffs/​ControlStructures/​ClosingBraceNewlineSniff.php Adds a trailing comma to a multiline call.
Makefile Runs PHP-CS-Fixer in dry-run mode during style checks.
composer.json Adds the shared configuration dependency, updates the fixer, and sorts dependencies.
.php-cs-fixer.dist.php Replaces local rules with the shared preset and project-specific overrides.

Review effort: Balanced

@donatj
donatj deleted the chore/shared-php-cs-fixer branch November 3, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants