rabbitinternet / cs-fixer
php-cs-fixer with github hook and config
Installs: 11 660
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 5
Forks: 1
Open Issues: 0
Language:Shell
Requires
- friendsofphp/php-cs-fixer: ^3.11.0
This package is not auto-updated.
Last update: 2023-03-23 19:52:28 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 rabbitinternet/cs-fixer
Add composer init-hook command
"scripts": {
"init-hook": "composer run-script post-install-cmd -d ./vendor/rabbitinternet/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
]
]