oscarotero/php-cs-fixer-config
Opinionated PHP-CS-Fixer configuration by Oscar Otero. Drop-in ruleset to standardize code style across projects, keep formatting consistent, and reduce bikeshedding. Ideal for teams wanting sensible defaults with minimal setup.
Add the package as a dev dependency to your project:
composer require --dev oscarotero/php-cs-fixer-config
Then, in your .php-cs-fixer.php config file (root of your project), require and use the provided config:
<?php
return (require_once 'vendor/oscarotero/php-cs-fixer-config/config.php')();
That’s it — you immediately get a consistent, opinionated ruleset without defining any rules manually. Run ./vendor/bin/php-cs-fixer fix to format your codebase.
composer.json to lock the style guide. Update via PR to ensure controlled evolution of rules.php-cs-fixer check --dry-run to fail CI if non-conforming code is introduced..php-cs-fixer.php as the config for auto-formatting — the config’s presence ensures consistency with CI.$config = (require_once 'vendor/oscarotero/php-cs-fixer-config/config.php')();
$config['rules']['my_custom_rule'] = true;
return $config;
^1.2) and update deliberately — review changelog before upgrading.rm -rf ~/.cache/php-cs-fixer/) — old rules can linger.ext-fileinfo and ext-tokenizer are installed; missing extensions can cause silent failures.braces for legacy compatibility), you’ll need to override per project, accepting the trade-off of losing centralization.__DIR__ . '/vendor/oscarotero/...' to ensure uniqueness and avoid fatal redeclaration errors.How can I help you explore Laravel packages today?