Skip to content

Add Php cs fixer#154

Merged
bytestream merged 9 commits into
Gregwar:masterfrom
lachlan-00:php-cs-fixer
Jun 23, 2026
Merged

Add Php cs fixer#154
bytestream merged 9 commits into
Gregwar:masterfrom
lachlan-00:php-cs-fixer

Conversation

@lachlan-00

@lachlan-00 lachlan-00 commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

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

  • gitattribute line endings set in dc12142
  • line_ending (added , at the end of array items)
  • ordered_class_elements has set visibility and alpha sort on functions with no other changes

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.

Copilot AI review requested due to automatic review settings June 19, 2026 22:01

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.

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-fixer to require-dev and introduce a project-level .php-cs-fixer.php configuration.
  • 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.

Comment thread .php-cs-fixer.php Outdated
Comment thread .gitattributes
Comment thread src/Gregwar/Captcha/CaptchaBuilder.php
Comment thread src/Gregwar/Captcha/CaptchaBuilder.php
@hanisko

hanisko commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

why not per 3.0?

@lachlan-00

Copy link
Copy Markdown
Contributor Author

why not per 3.0?

I just copied my existing file from Ampache and updated to remove specifics there. The changes implemented by the rules specifically are 2 trailing commas on multiline.

I've added @PER-CS3x0 with bbdf276 and that's only changed some minor spacing as well

@bytestream bytestream merged commit a0b093f into Gregwar:master Jun 23, 2026
4 checks passed
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.

4 participants