Add Php cs fixer#154
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces PHP-CS-Fixer to the project’s dev toolchain and applies formatting-oriented reordering/cleanup across a few PHP files (primarily ordering of class elements), with the intent of standardizing style and enforcing consistent function ordering going forward.
Changes:
- Add
friendsofphp/php-cs-fixertorequire-devand introduce a project-level.php-cs-fixer.phpconfiguration. - Apply php-cs-fixer-driven ordering changes to source and test files (method/property ordering, minor formatting).
- Add Git settings updates for line endings and ignore the php-cs-fixer cache file.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Captcha/CaptchaBuilderTest.php | Reorders test methods to match configured ordering rules. |
| src/Gregwar/Captcha/PhraseBuilder.php | Reorders static helpers and updates constructor formatting (trailing comma). |
| src/Gregwar/Captcha/CaptchaBuilderInterface.php | Reorders interface method declarations (no signature changes). |
| src/Gregwar/Captcha/CaptchaBuilder.php | Reorders properties/methods and reorganizes code blocks to match style rules. |
| composer.json | Adds php-cs-fixer as a dev dependency. |
| .php-cs-fixer.php | Adds php-cs-fixer configuration and rule set for the repo. |
| .gitignore | Ignores php-cs-fixer cache file. |
| .gitattributes | Adds LF normalization settings. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
why not per 3.0? |
Contributor
Author
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.
You'd mentioned function ordering in my last pull so i'm adding in php-cs-fixer to require-dev
I've added rules i think you'd want
Changes from the rules are
no functional changes but i could also add scripts to composer so you can run these commands from composer which i use a heap (e.g. composer cs:fix, composer cs:check)
You could also set cs analysis on the repo for pulls, etc but in this pull i've really just decided to set the rules and apply them.