Skip to main content

Posts

Showing posts from 2021

Drupal Coding standard check

  Installing and checking Drupal coding standards using PHP CodeSniffer consists of the following steps at high level. Install PHP CodeSniffer Install Coder Register Drupal standards in PHP Codesniffer Run the sniffs Installing PHP code sniffer :  1-  composer global require drupal / coder You can check the location of the installation path by below command composer global show -P if you are in a windows machine then you need to update the below path in environment variable as a PATH key, PATH : C:\Users\dharmendra.singh\AppData\Roaming\Composer\vendor\bin and reopen the terminal to apply changes. Install the below composer global require drupal/coder dealerdirect/phpcodesniffer-composer-installer And Manually set installed paths : phpcs --config-set installed_paths C:/Users/dharmendra.singh/AppData/Roaming/Composer/vendor/drupal/coder/coder_sniffer Installation is Done You can verify this has worked or not phpcs -i The above command should include DrupalPractice ...