Repository navigation
Use shared PHP-CS-Fixer configuration - #29
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-publishandmake teston PHP 8.5. The fixer dry run is clean. All eight tests pass.