Skip to content

Instantly share code, notes, and snippets.

@atillay
Last active August 22, 2018 07:37
Show Gist options
  • Save atillay/2129c1e52bcfc6bbfcd34971f54bc583 to your computer and use it in GitHub Desktop.
Save atillay/2129c1e52bcfc6bbfcd34971f54bc583 to your computer and use it in GitHub Desktop.
Setup PHPCS, PHPMD and PHP-CS-FIXER with Intellij globally

Run the following commands :

  • $ composer global require phpmd/phpmd
  • $ composer global require squizlabs/php_codesniffer
  • $ composer global require friendsofphp/php-cs-fixer
  • $ nano ~/.bash_profile and put export PATH=~/.composer/vendor/bin:$PATH (make sure path is correct)
  • $ source ~/.bash_profile

Go to Intellij > Preferences > Languages & Frameworks > PHP and add path for Mess Detector and Code Sniffer (ex: ~/.composer/vendor/bin/phpmd)
Go to Intellij > Preferences > Editor > Inspections and enable PHP Mess Detection validation + PHP Code Sniffer validation

Done

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