mfn/php-cs-fixer-config
Opinionated php-cs-fixer rule set for v3.11 and up, packaged as a simple config class. Requires setRiskyAllowed(true). Just require the autoloader, grab the rules, and pass them to your PhpCsFixer config.
Architecture fit: This is a pure configuration package, not a Laravel runtime dependency. It exposes Mfn\PhpCsFixer\Config::getRules() and does not add service providers, middleware, facades, or runtime hooks. It fits Laravel/PHP projects that already use php-cs-fixer and want a shared, opinionated ruleset without building one internally. It is Laravel-agnostic, so any Laravel-specific compatibility must be validated by the adopting team.
Integration feasibility: Low effort. Add it as a dev dependency, load the rules array in php-cs-fixer config, and enable setRiskyAllowed(true). It works locally and in CI without Laravel-specific wiring. The main prerequisite is php-cs-fixer v3.11+ and a modern PHP baseline; the rules include PHP 8.4-oriented options, so mixed-version codebases need validation.
Technical risk: Low code risk, moderate governance risk. The package has 0 stars, 0 dependents, issues disabled, no explicit license, and highly opinionated rules. Risky rules can produce large formatting diffs, and rules such as import ordering or alias handling may conflict with Laravel patterns. Upstream support is PR-only, and future php-cs-fixer major versions may require manual rule validation. License ambiguity should be reviewed before enterprise adoption.
Key questions: Who owns this ruleset internally? Is the missing license acceptable to legal? Will we pin both this package and php-cs-fixer? Do we need documented exceptions for facades, aliases, Blade-adjacent files, or dynamic properties? Are we standardizing on php-cs-fixer directly or using Pint as well? How will we measure success: PR cycle time, style-related review comments, onboarding time, or reduced config maintenance?
Stack fit: Best suited to Laravel/PHP repositories using php-cs-fixer directly or in CI, especially small-to-medium teams without a mature style guide. It is less suitable for teams with strong in-house conventions, legacy mixed-PHP codebases, enterprise support requirements, or strict PSR-12-only preferences. If the team uses Laravel Pint, confirm whether introducing a separate php-cs-fixer ruleset creates dual-tooling friction.
Migration path: Start with one pilot repository. Inventory existing rules, add the package as a dev dependency, replace the rules array, and run php-cs-fixer fix --dry-run --diff. Review the diff size and Laravel-specific false positives before applying changes. Commit the baseline formatting separately, then add CI enforcement. Run the pilot for one or two sprints, measure review friction and merge time, and expand only if the ruleset is stable. Preserve the old config and pinned versions for rollback.
Compatibility: Pin mfn/php-cs-fixer-config and friendsofphp/php-cs-fixer together. Validate the project PHP version, especially if relying on PHP 8.4-related rules. Exclude generated, vendor, and Blade-template paths from the finder unless explicitly tested. Because the package has no license and no issue tracker, adoption may require legal review or an internal fork/vendored ruleset if governance blocks direct dependency use.
Sequencing: First perform a legal/governance check on the missing license and disabled issue tracker. Then run a dry-run pilot in a low-risk repository. Document exceptions for Laravel-specific patterns. Add CI in report-only mode before enforcing. Measure impact, then roll out repository by repository with a pinned version and shared CI template. A TPM should treat this as a starter ruleset or internal fork candidate, not a strategic platform dependency, until support and licensing are clarified.
Maintenance: Runtime maintenance is effectively zero because this is a dev-only config package. The real maintenance burden is version pinning, rule-exception management, and validating php-cs-fixer upgrades. With no upstream issue tracker and low adoption, the team should assign a lightweight internal owner for upgrades and rule changes.
Support: There is no official support channel, no SLA, and issues are disabled. Support depends on upstream PRs or an internal fork. The missing license adds legal uncertainty. TPM should budget a small amount of engineering-owner time for triage, documentation, and periodic compatibility checks.
Scaling: The package scales cheaply across many repositories as a shared dev dependency. The main scaling risks are version drift and inconsistent exceptions between teams. Standardize on one pinned package version, one php-cs-fixer version, and a shared CI template to avoid repo-by-repo divergence.
Failure modes: Upstream abandonment, php-cs-fixer major-version breakage, risky rules causing large reformatting diffs, false positives on Laravel conventions, license review blocking adoption, and slow fixes due to disabled issues. Mitigations include dry-run first, report-only CI, pinned versions, documented exceptions, an internal fork/backup, and legal review before broad rollout.
Ramp-up: Developer ramp-up is fast, typically under an hour: add the dev dependency, call getRules(), enable risky rules, and run the fixer. TPM/engineering-lead ramp-up is slightly longer, roughly one to two days for pilot setup, CI configuration, exception documentation, and success measurement. Onboarding cost is low; the main effort is governance, change management, and deciding whether to depend on or fork the ruleset.
How can I help you explore Laravel packages today?