beste/php-cs-fixer-config
Shared PHP-CS-Fixer configuration package providing a consistent, reusable code style setup across projects. Centralizes fixer rules and presets, making it easy to enforce formatting standards in CI and keep multiple codebases aligned with minimal per-project config.
composer require --dev beste/php-cs-fixer-config
.php-cs-fixer.php to extend the shared config:
<?php
return (new Beste\PhpCsFixerConfig\Config())
->setUsingCache(true)
->setRiskyAllowed(true);
vendor/bin/php-cs-fixer fix --dry-run
php-cs-fixer check.->setRules([...]) or ->prependRule(...) for project-specific tweaks without duplicating the core rules.vendor/bin/php-cs-fixer fix --dry-run --diff to fail builds on style violations.husky + lint-staged to auto-fix staged files:
"lint-staged": {
"*.php": ["vendor/bin/php-cs-fixer fix"]
}
beste/php-cs-fixer-config once in root and reference it across subpackages via relative paths.php_unit_strict, php_unit_test_annotation). Explicitly set ->setRiskyAllowed(true) to avoid silent failures.setPhpVersion() if supporting older versions:
->setPhpVersion(80100)
->setUsingCache(true)) to speed up repeated runs locally/CI — but ensure CI clears caches when rules change.Config in your project to add project-specific helpers (e.g., custom finder sets), then extend that class instead of copying rules.vendor/bin/php-cs-fixer describe to inspect enabled rules or verify rule changes after package updates.^1.2) to control upgrades.How can I help you explore Laravel packages today?