redaxo/php-cs-fixer-config
Opinionated PHP-CS-Fixer configuration for REDAXO projects. Ships a ready-to-use ruleset to standardize code style and enforce consistent formatting across your codebase, making it easier to keep teams aligned and reviews focused on logic, not whitespace.
composer require --dev redaxo/php-cs-fixer-config
.php-cs-fixer.php in your project root and extend the shared config:
<?php
return (new PhpCsFixer\Config())
->setRuleset('redaxo')
->setFinder(PhpCsFixer\Finder::create()->in(__DIR__));
vendor/bin/php-cs-fixer fix
vendor/bin/php-cs-fixer fix --dry-run --diff
.php-cs-fixer.php to ensure consistency.->setRules([
'phpdoc_summary' => true,
'blank_line_between_statements' => false, // disable if unwanted
])
.in() calls or custom finder logic to exclude vendor, tests, or generated files:
->setFinder(
PhpCsFixer\Finder::create()
->in(['src', 'lib', 'boot.php'])
->notPath('vendor')
);
php-cs-fixer version aligns—check composer.lock for php-cs-fixer/php-cs-fixer constraints.setRuleset('redaxo') override defaults. Avoid calling setRuleset() multiple times.::class on objects). Verify target project’s PHP version compatibility.--verbose to see applied rules:
vendor/bin/php-cs-fixer fix -vvv
Redaxo\PhpCsFixer\Config::create()—perfect for advanced usage in custom config scripts:
$config = Redaxo\PhpCsFixer\Config::create();
$config->setRules([...]);
return $config;
How can I help you explore Laravel packages today?