php-cs-fixer/shim
Shim package for PHP CS Fixer, providing a lightweight Composer entrypoint and compatibility layer. Use this package to pull in PHP-CS-Fixer via Composer; for configuration, usage, and docs, see the main FriendsOfPHP/PHP-CS-Fixer repository.
The php-cs-fixer/shim package provides a lightweight, self-contained PHAR distribution of PHP CS Fixer, ideal for projects wanting to avoid installing the full friendsofphp/php-cs-fixer package (which pulls many dependencies). To start:
composer require --dev php-cs-fixer/shimphar.readonly = Off in php.ini if running PHARs globally or via Composer scripts)./vendor/bin/php-cs-fixer --version./vendor/bin/php-cs-fixer fix src/This is especially useful in CI pipelines or constrained environments where minimizing dependency bloat matters. Begin with the main PHP CS Fixer docs for configuration and rule sets.
php-cs-fixer fix --dry-run before build steps to fail fast on style violations.pre-commit via husky + lint-staged or custom shell scripts:
./vendor/bin/php-cs-fixer fix --path-mode=override src/ tests/
.php-cs-fixer.php (or .php-cs-fixer.dist.php) in project root to define rulesets (e.g., @Symfony, @PSR12, or custom rules). The shim respects Composer’s autoloading and config discovery.return PhpCsFixer\Config::create()
->setRules([
'@PSR12' => true,
'phpdoc_summary' => false,
'single_blank_line_before_namespace' => true,
]);
use its classes directly.^3.54) to avoid unexpected rule changes in CI.phar “…” has wrong permissions, ensure the PHAR file (vendor/bin/php-cs-fixer) is executable:chmod +x vendor/bin/php-cs-fixer-vvv for verbose output or --dry-run to preview changes. If rules don’t apply as expected, check your config file path and rules syntax (e.g., using string keys like 'array_syntax' => ['syntax' => 'short']).friendsofphp/php-cs-fixer, since it avoids conflicts if the full package is still installed elsewhere.How can I help you explore Laravel packages today?