kubawerlos/php-cs-fixer-custom-fixers
A collection of custom fixers for PHP CS Fixer that adds extra coding-standard rules beyond the built-in set. Install via Composer, register the custom fixers, and enable rules for cleaner, more consistent PHP code.
composer remove and deleting config lines — which means it should be trialed rather than debated.NoDuplicatedArrayKeyFixer (silent key collisions), NoUselessStrlenFixer, NoSuperfluousConcatenationFixer, NoDuplicatedImportsFixer, PhpUnitAssertArgumentsOrderFixer (inverted expected/actual assertions produce misleading failure output). These are defects a PM can point to in a retro.NoPhpStormGeneratedCommentFixer, NoDoctrineMigrationsGeneratedCommentFixer, NoUselessDoctrineRepositoryCommentFixer, NoCommentedOutCodeFixer give you a mechanical, reviewable diff for "clean up the old repo" work — useful for sizing a tech-debt sprint instead of estimating it by hand.DataProvider*, InternalClassCasing, MultilinePromotedProperties, NumericLiteralSeparator). This tells you the package's value is a moving frontier, not a fixed asset — so decide up front whether you're committing to tracking its releases, and budget a small annual migration task. Do not enable deprecated fixers; they will break on upgrade.Adopt when:
friendsofphp/php-cs-fixer) in CI and are on a maintained 3.x line with PHP 8.x.@PSR12 / @Symfony / @PhpCsFixer presets and you're hand-enforcing rules in code review.isset vs array_key_exists, reference parameters), not just whitespace.Look elsewhere / defer when:
Also flag: single-maintainer project (~244 stars, low dependent count). Bus factor is the primary risk. Acceptable here because the blast radius is a dev dependency you can fork or drop, but it argues for pinning the version and treating upgrades as scheduled work, not automatic.
To executives (30 seconds): A free, MIT-licensed add-on for our existing PHP linting tool. It's a development-only dependency — it never ships to production and cannot affect users. Setup is roughly half a day; the payoff is fewer manual style corrections in code review and a handful of real defect classes caught automatically (duplicate array keys, misleading test assertions, dead commented-out code). Fully reversible if it doesn't work out.
To engineering: Add kubawerlos/php-cs-fixer-custom-fixers as a require-dev dependency, register new PhpCsFixerCustomFixers\Fixers() in the existing .php-cs-fixer.php config, and enable fixers by name. Rollout:
NoDuplicatedArrayKeyFixer, NoDuplicatedImportsFixer, NoUselessParenthesisFixer, CommentSurroundedBySpacesFixer, NoTrailingCommaInSinglelineFixer).ForeachUseValueFixer, IssetToArrayKeyExistsFixer, NoNullableBooleanTypeFixer, NoReferenceInFunctionDefinitionFixer, CommentedOutFunctionFixer) per-directory, with a code owner reviewing the first pass — each has documented behavioral caveats.php-cs-fixer/shim package, add the bootstrap.php require to the config, or classes won't load.DEPRECATED-marked fixers from config; schedule a quarterly check against upstream PHP CS Fixer so absorbed rules are migrated rather than left to break.Success metrics: count of style-only review comments per PR (target: near zero), PR time-to-approval, and lint failures caught pre-merge vs. style nits caught in review. Re-evaluate after one quarter — if the fixer config isn't being extended or maintained, that's a signal the team didn't actually want the stricter baseline.
How can I help you explore Laravel packages today?