I’ve been wanting to get onto PHPCS for quite some time now. While reading a blog post discussing it, I decided it was now or never. I should have started using PHPCS a while ago anyway…

So, in order to get things up and running, I did a quick Google search and ended up finding a pretty good tutorial, except that it is slightly outdated. Some of the instructions did not match the latest version of PhpStorm.

The article is How to Setup PHP Code Sniffer in Phpstorm on a Windows Machine from W3Guy.com.

NOTE: At the time of writing this article, I was running PhpStorm version 2016.2.1.

Most of the instructions are correct, except for a couple of them. Here is an updated version of the outdated steps. Also, you’ll need to have PEAR installed on your local machine beforehand.

Step 2

You will actually need to copy all the WordPress-xxx directories in CodeSniffer’s Standards directory as they rely on one another (otherwise you’ll get errors in PhpStorm).

Also, because I’m only using standard PHP on my local machine (no XAMPP or any pre-packaged web server), […]

Continue reading →