This is essential development tool that ensures your code remains clean and consistent.
composer require symplify/php7_codesniffer --devRun it from cli:
vendor/bin/php7cs src --standards=PSR2To fix the issues just add --fix:
vendor/bin/php7cs src --standards=PSR2 --fixvendor/bin/php7cs src --sniffs=PSR2.Classes.ClassDeclaration
vendor/bin/php7cs src --sniffs=PSR2.Classes.ClassDeclaration,Zend.Files.ClosingTagYou can combine them as well:
vendor/bin/php7cs src --standards=PSR2 --sniffs=Zend.Files.ClosingTagvendor/bin/php7cs src --standards=PSR2 --exclude-sniffs=PSR2.Namespaces.UseDeclarationbin/php7cs src tests --standards=PSR2
vendor/bin/phpunitRules are simple:
- new feature needs tests
- all tests must pass
- 1 feature per PR
I'd be happy to merge your feature then.