I want to configure code sniffer in phpstorm so i can refactor my code according to Magento coding standards
1 Answer
Code Sniffer Configurations:
Open PHPStorm, Alt + Ctrl + S Select PHP > Quality Tools > PHP_Codesniffer > ... > Give the path of "Suizlabs/PHP_Codesniffer/bin/phpcs" Then validate it and apply/Ok
Select Editor > Inspections > PHP > Quality Tools > Check the PHP_CodeSniffer validation Then in OPTIONS on the right side check all the options Give path of "vendor/magento/magento-coding-standard/Magento2" to Installed standards path
After that select "magento2" from the coding standard dropdown and apply/Ok.
Steps to properly configure spacing or lint feature in PHPStorm:
ctrl + alt + s Editor --> Code Style --> PHP --> Set from --> PSR1/PSR2 Apply and OK Press CTRL + ALT + L or CTRL + ALT + SHIFT + L
-
2
-