Skip to main content
added 133 characters in body
Source Link
Pradeep Kumar
  • 8.8k
  • 12
  • 62
  • 86

i followed below steps in windows local system first installed xammp

  1. cd C:\xampp\php
  2. pear install PHP_CodeSniffer pear install --alldeps PHP_CodeSniffer

(if there is any issue run cmd as Administrator)

enter image description here

phpcs -i

  1. then to follow Magento coding install magento-ecg/coding-standard throwfrom composer

  2. after install it will be in \CC:\xampp\htdocs\magento217\vendor\magento-ecg\

  3. now run (C:\xampp\php>) phpcs

    phpcs --config-set installed_paths \CC:\xampp\htdocs\magento217\vendor\magento-ecg\coding-standard

now it will have all plugins need for M2

phpcs -i

The installed coding standards are PSR1, PSR2, PEAR, MySource, PHPCS, Zend, Squiz, Ecg and EcgM2

To test Module run below code

C:\xampp\php>phpcs C:\xampp\htdocs\magento217\app\code\NAMESPACE\MODULE_NAME

i followed below steps in windows local system first installed xammp

  1. cd C:\xampp\php
  2. pear install PHP_CodeSniffer pear install --alldeps PHP_CodeSniffer

(if there is any issue run cmd as Administrator)

enter image description here

phpcs -i

  1. then to follow Magento coding install magento-ecg/coding-standard throw composer

  2. after install it will be in \C:\xampp\htdocs\magento217\vendor\magento-ecg\

  3. now run (C:\xampp\php>) phpcs --config-set installed_paths \C:\xampp\htdocs\magento217\vendor\magento-ecg\coding-standard

now it will have all plugins need for M2

phpcs -i

The installed coding standards are PSR1, PSR2, PEAR, MySource, PHPCS, Zend, Squiz, Ecg and EcgM2

i followed below steps in windows local system first installed xammp

  1. cd C:\xampp\php
  2. pear install PHP_CodeSniffer pear install --alldeps PHP_CodeSniffer

(if there is any issue run cmd as Administrator)

enter image description here

phpcs -i

  1. then to follow Magento coding install magento-ecg/coding-standard from composer

  2. after install it will be in C:\xampp\htdocs\magento217\vendor\magento-ecg\

  3. now run (C:\xampp\php>)

    phpcs --config-set installed_paths C:\xampp\htdocs\magento217\vendor\magento-ecg\coding-standard

now it will have all plugins need for M2

phpcs -i

The installed coding standards are PSR1, PSR2, PEAR, MySource, PHPCS, Zend, Squiz, Ecg and EcgM2

To test Module run below code

C:\xampp\php>phpcs C:\xampp\htdocs\magento217\app\code\NAMESPACE\MODULE_NAME
Source Link
Pradeep Kumar
  • 8.8k
  • 12
  • 62
  • 86

i followed below steps in windows local system first installed xammp

  1. cd C:\xampp\php
  2. pear install PHP_CodeSniffer pear install --alldeps PHP_CodeSniffer

(if there is any issue run cmd as Administrator)

enter image description here

phpcs -i

  1. then to follow Magento coding install magento-ecg/coding-standard throw composer

  2. after install it will be in \C:\xampp\htdocs\magento217\vendor\magento-ecg\

  3. now run (C:\xampp\php>) phpcs --config-set installed_paths \C:\xampp\htdocs\magento217\vendor\magento-ecg\coding-standard

now it will have all plugins need for M2

phpcs -i

The installed coding standards are PSR1, PSR2, PEAR, MySource, PHPCS, Zend, Squiz, Ecg and EcgM2