Atom Editor, PHP CodeSniffer And Drupal Coding Standards

Keep watch your code directly from your code editor


This way will help you keep watching Drupal coding standards while you're writing your code inside your Atom editor.

  // Make sure you have composer installed in your machine.
  // Then run this command.
  composer global require drupal/coder
// Add this line in ~/.bashrc file to make sure everytime you turn on your machine it will be executed.
export PATH="$PATH:$HOME/.composer/vendor/bin"
  // You can verify this has worked with:
  phpcs -i
  // Copy (Drupal) and (DrupalPractice) folders to (Standards) folder or just make a symbolic link.
  ln -s ~/.composer/vendor/drupal/coder/coder_sniffer/Drupal ~/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/Drupal
  ln -s ~/.composer/vendor/drupal/coder/coder_sniffer/DrupalPractice ~/.composer/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/DrupalPractice
  // Here is the Atom package for drupal coding standards using PHP code sniffer:


فضلاً إذا أعجبتك هذه الصفحة لاتنسى أن تقوم بمشاركتها