spiral / code-style
Code style and static analysis tools rulesets collection
Installs: 180 815
Dependents: 21
Suggesters: 0
Security: 0
Stars: 3
Watchers: 8
Forks: 0
Open Issues: 2
Requires
- php: >=7.4
- friendsofphp/php-cs-fixer: ^3.8
- squizlabs/php_codesniffer: ^3.5
Requires (Dev)
- phpunit/phpunit: ^9.5.5
README
This repository contains ruleset for static analyses tools. Currently supported:
Current codestyle is PSR-12.
PHP Codesniffer ruleset is located in config/ruleset.xml
.
PHP CS Fixer ruleset is located in config/.php_cs
To apply it in your project do the following:
Install the package
composer require --dev spiral/code-style
Check the code
#vendor/bin/spiral-cs check <dir1> <dir2> <file1>....
vendor/bin/spiral-cs check src tests
Automatically fix the code style
#vendor/bin/spiral-cs fix <dir1> <dir2> <file1>....
vendor/bin/spiral-cs fix src tests