A PHP coding standard based on slevomat/coding-standard.
composer require martinhons/coding-standard --devFor check the coding standard for the src and tests directories run:
vendor/bin/phpcs --standard=HonsStandard src testsTo automatically fix coding standard issues int the src and tests directories run:
vendor/bin/phpcbf --standard=HonsStandard src testsFor easier usage you can add the following scripts to your composer.json:
{
"scripts": {
"cs": "phpcs --standard=HonsStandard <YOUR_CODE_DIRECTORIES>",
"csf": "phpcbf --standard=HonsStandard <YOUR_CODE_DIRECTORIES>"
}
}Replace <YOUR_CODE_DIRECTORIES> with your code directory or directories.
Then you can run:
composer cs # Check coding standards
composer csf # Fix coding standards automatically