Setup the PHPStorm local IDE on Mac for Drupal project
- Install PHPCS globally composer global require squizlabs/php_codesniffer
- Execute nano ~/.zshrc then add this line export PATH="$HOME/.composer/vendor/bin:$PATH" At the end of this file and save. And then read it again as a source source ~/.zshrc. (THIS IS APPLICABLE IF YOU ARE USING ZSH)
- Make sure the PHPCS command is installed and working fine now by executing which phpcs
- Install Drupal coding standard extension composer global require drupal/coder and then composer global require dealerdirect/phpcodesniffer-composer-installer
- Enable Drupal integration. Open PHPStorm. Goto Preferences. Go to PHP then Frameworks And enable Drupal and set the right folder path. (or search for drupal in the list for quick access)
- On PHPStorm. Click File menu and click Invalidate Cache.. and check all the options. To re-index the project.