beste/php-cs-fixer-config
Opinionated PHP-CS-Fixer configuration for BESTE projects, extending ergebnis/php-cs-fixer-config. Provides ready-to-use rulesets for modern PHP (Php81 and Php82) to keep code style consistent across your codebase.
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?