Back-end coding standards used at Chrometoaster are based on PSR-2.
This project bundles tools along with predefined rulesets for automated checks. Provided tools:
- PHP-Parallel-Lint
- EasyCodingStandard that combines PHP-CS-Fixer and PHP_CodeSniffer
-
Install this package:
$ composer require --dev chrometoaster/backend-coding-standards:~1.0
-
Include a configuration file in your
easy-coding-standard.yml
:imports: - { resource: '%vendor_dir%/chrometoaster/backend-coding-standards/config/chrometoaster.yml' }
-
Check your files
$ vendor/bin/parallel-lint /path/to/source/code $ vendor/bin/ecs check path/to/source/code
-
Auto-fix non-compliant files where possible
$ vendor/bin/ecs check path/to/source/code --fix
See the official documentation of the tools used for further information, e.g. how to provide a custom config.
BSD-3-Clause