Skip to content

Instantly share code, notes, and snippets.

@osrecio
Created June 14, 2017 11:43
Show Gist options
  • Save osrecio/d302b0bff753253d4de134210f838329 to your computer and use it in GitHub Desktop.
Save osrecio/d302b0bff753253d4de134210f838329 to your computer and use it in GitHub Desktop.
Add PHPCS PHPStorm for Magento

Install PHPCS and add Magento Standars

composer global require magento-ecg/coding-standard
composer global require magento/marketplace-eqp
export PATH=$HOME/bin:/usr/local/bin:$PATH:$HOME/.composer/vendor/bin
phpcs --config-set installed_paths $HOME/.composer/vendor/magento-ecg/coding-standard/,$HOME/.composer/vendor/magento/marketplace-eqp/

Configure PHPCS into PHP Storm

Settings > Languages & Frameworks > PHP > CodeSniffer

put the path for phpcs (locate it with which phpcs in your terminal) and validate it, apply and we're done.

Settings > Editor > Inspections > PHP > PHP Code Sniffer validation

Enable it and search in the screen for Coding Standard and pick Ecg, EcgM2, MEQP1 and MEQP2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment