ergebnis/php-cs-fixer-config
Factory package for friendsofphp/php-cs-fixer configs. Provides ready-made rule sets per PHP version (5.3–8.5) and helpers to build a consistent, reusable fixer configuration for your projects.
friendsofphp/php-cs-fixer, aligning with Laravel’s PHP-centric ecosystem. It reduces boilerplate for teams enforcing consistent coding standards..php-cs-fixer.php file), fitting Laravel’s CI/CD pipelines (e.g., GitHub Actions).phpunit)..build/php-cs-fixer) avoids runtime overhead, critical for production-like environments.friendsofphp/php-cs-fixer (v3.x+), which may introduce breaking changes (e.g., PHP 8.3+ features). Monitor PHP-CS-Fixer’s changelog.erickskrauch/php-cs-fixer-custom-fixers) may conflict with Laravel’s existing tooling (e.g., Pest, Laravel Pint).use App\Models\* imports). Requires manual overrides.Php83+ rule sets.composer scripts or Makefile targets..php-cs-fixer.dist.php.composer.json (require-dev)..php-cs-fixer.php for a subset of files (e.g., app/).--dry-run mode to validate changes.tests/ and config/ directories..php-cs-fixer.dist.php with this package’s rule sets.$ruleSet = Php81::create()->withRules(Rules::fromArray([
'no_unused_imports' => true, // Laravel’s Facade imports
'ordered_imports' => ['sort_algorithm' => 'alpha'],
]));
spatie/php-cs-fixer-custom-fixers).pint with php-cs-fixer in composer.json:
"scripts": {
"cs-fix": "php-cs-fixer fix --config=.php-cs-fixer.php --allow-risky=yes"
}
composer cs-fix or a VSCode task..gitignore but version-control the config file.friendsofphp/php-cs-fixer for breaking changes (e.g., PHP 8.4+ features).CODE_OF_CONDUCT.md or CONTRIBUTING.md.README.md snippet for new devs:
## Coding Standards
Run `composer cs-fix` to auto-fix issues. Configure rules in `.php-cs-fixer.php`.
SUPPORT.md.--parallel flag for large codebases (PHP-CS-Fixer v3.10+).| Scenario | Impact | Mitigation |
|---|---|---|
| PHP-CS-Fixer breaking change | Config invalidation | Pin to a stable version (e.g., ^6.0). |
| Custom fixer conflicts | Build failures | Test in isolation before merging. |
| Cache corruption | Flaky CI runs | Use --no-cache in CI as fallback. |
| Rule set misconfiguration | Overly strict/lenient standards | Audit with php-cs-fixer fix --dry-run. |
array_syntax, concat_space).app/Console/, app/Http/Controllers/).How can I help you explore Laravel packages today?