Use Git Bash instead of default command line https://git-scm.com/download/win
Download and install Visual C++: https://aka.ms/vs/15/release/VC_redist.x64.exe
Download PHP: https://windows.php.net/download/ || https://windows.php.net/downloads/releases/php-7.3.7-nts-Win32-VC15-x64.zip
- Create a new folder in c:\php7 and extract your PHP zip to it.
- Add c:\php7 as Path Environment Variable
- Open System Properties by clicking the start menu and typing sysdm.cpl and press Enter.
- In System Properties, click Environment Variables.
- In System Variables, click Path and then click Edit.
- Click New, type the path to your PHP folder (c:\php7) and click OK.
- Close the System Properties dialogue by clicking OK.
- If you have any Command Prompt windows currently open, close them.
- Open Command Prompt, type php -v and press Enter. You should now see the PHP version.
Install Composer: https://getcomposer.org/download/
- If Setup prompts to create php.ini, allow it and click Next.
- Skip the Proxy URL settings, just click Next then click Install.
- Click Finish once install is complete.
In Git Bash command prompt
composer global require "squizlabs/php_codesniffer=*"
In Git Bash command prompt
composer global require "wp-coding-standards/wpcs"
phpcs --config-set installed_paths C:\\Users\\USERNAME\\AppData\\Roaming\\Composer\\vendor\\wp-coding-standards\\wpcs
(ReplaceUSERNAME
with your actual username)phpcs --config-set default_standard WordPress-Extra
phpcs -i
should now return "The installed coding standards are MySource, PEAR, PSR1, PSR12, PSR2, Squiz, Zend, WordPress, WordPress-Core, WordPress-Docs and WordPress-Extra"
https://gist.github.com/nunomorgadinho/b2d8e5b8f5fec5b0ed946b24fa288a91