Using PHP CodeSniffer with Magento 2

You can get an Audit of the most severe Errors and Warnings by running the following command.

./vendor/bin/phpcs --standard=Magento2 --error-severity=1 --warning-severity=9 --tab-width=4 ./app/code

Secondary to that you can have PHPCBF auto-fix many of the errors and warnings by running the following.

./vendor/bin/phpcbf --standard=Magento2 --error-severity=1 --warning-severity=9 --tab-width=4

 

Gareth
Buy Me A Coffee
back arrowBack to Index