Setup PHP CodeSniffer in PHPStorm

March 12 2015, 5:52pm

Install PHP Code Sniffer Using Composer Globally:

composer global require "squizlabs/php_codesniffer=*"

Enable PHP Codesniffer:

Preferences > Languages & Frameworks > PHP > Code Sniffer

path: [get this from running 'which phpcs' in the terminal]

Enable PHPStorm to run Code Sniffer in realtime to detect PSR-2 problems:

Preferences > Inspections > PHP > PHP CodeSniffer validation