altelma / cs-fixer
php-cs-fixer with Github hook and config
Installs: 171
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/altelma/cs-fixer
Requires
- friendsofphp/php-cs-fixer: ^2.3.2
This package is auto-updated.
Last update: 2025-09-17 05:22:33 UTC
README
This package is based on https://github.com/FriendsOfPHP/PHP-CS-Fixer with addition of git pre-commit hook installation.
The hook will prevent the commit if the code does not comply with the coding standard rules
Default set of rules that are fully extendable
Installation
Require a package
composer require --dev altelma/cs-fixer
Add composer init-hook command
"scripts": {
"init-hook": "composer run-script post-install-cmd -d ./vendor/altelma/cs-fixer"
}
Install the git hook
composer run-script init-hook
Manual Usage
vendor/bin/cs-fixer help
Note: Composer can install the binaries in custom dir instead of vendor/bin/ (sylius installs in bin/)
Rules configuration
To override default rules add .php_cs_rules.php
file in the root of the project
<?php
return [
'finder' => [
'exclude' => [
'var'
],
'notName' => [
'autoload.php',
],
'fixer' => [
'single_blank_line_at_eof' => true
]
]