i followed below steps in windows local system first installed xammp
- cd C:\xampp\php
- pear install PHP_CodeSniffer pear install --alldeps PHP_CodeSniffer
(if there is any issue run cmd as Administrator)
phpcs -i
then to follow Magento coding install magento-ecg/coding-standard throwfrom composer
after install it will be in \CC:\xampp\htdocs\magento217\vendor\magento-ecg\
now run (C:\xampp\php>) phpcs
phpcs --config-set installed_paths \CC:\xampp\htdocs\magento217\vendor\magento-ecg\coding-standard
now it will have all plugins need for M2
phpcs -i
The installed coding standards are PSR1, PSR2, PEAR, MySource, PHPCS, Zend, Squiz, Ecg and EcgM2
To test Module run below code
C:\xampp\php>phpcs C:\xampp\htdocs\magento217\app\code\NAMESPACE\MODULE_NAME