mfn/php-cs-fixer-config
Opinionated php-cs-fixer ruleset for v3.11+ from MFN. Provides a ready-to-use rule array via Mfn\PhpCsFixer\Config::getRules(); enable setRiskyAllowed(true) in your php-cs-fixer config and apply the rules.
require 'vendor/autoload.php') and a single method call (getRules()) to replace custom PHP-CS-Fixer rules.php-cs-fixer package) or custom configurations in php-cs-fixer.dist.php.setRiskyAllowed(true), which may introduce non-backward-compatible changes (e.g., aggressive refactoring). Assess alignment with team standards before adoption.setRiskyAllowed(true) acceptable for the codebase?phpunit, pest)?php-cs-fixer package (via php-cs-fixer composer dependency).php-cs-fixer.dist.php configs (e.g., in root or tests/).php-cs-fixer fix.php-cs-fixer --dry-run).setRules() in php-cs-fixer.dist.php with:
require __DIR__.'/vendor/autoload.php';
$rules = \Mfn\PhpCsFixer\Config::getRules();
return (new PhpCsFixer\Config())
->setFinder($finder)
->setRiskyAllowed(true)
->setRules($rules);
php-cs-fixer fix --dry-run..github/workflows/php-cs-fixer.yml or equivalent to use the new config.composer.json).*.blade.php) may need custom finder paths.Route::) might trigger false positives for "unused imports."rector (if used for refactoring).psalm/phpstan (if strict type rules differ).php-cs-fixer fix) for non-breaking changes.--parallel).| Scenario | Impact | Mitigation |
|---|---|---|
| Rules break existing code | CI failures, dev friction | Whitelist exceptions or override rules. |
| PHP-CS-Fixer major update | Config incompatibility | Pin version or fork the package. |
| No license clarity | Legal ambiguity (unlikely) | Add MIT/Apache license to LICENSE. |
| Disabled PRs/issues | Stalled customizations | Fork and maintain privately. |
setRiskyAllowed(true) is used.How can I help you explore Laravel packages today?