Using PHP CodeSniffer is one of those tools that is part of my workflow that I find utterly invaluable. I haven’t always used it, though.
Don’t get me wrong: If you’ve read this blog for any length of time, you know I’m big on Coding Standards. But when it came to the PHP CodeSniffer, there was an extended period I had gone before I installed it.
Why, though?
Simply put, it was because I didn’t know it existed, at least not for WordPress. When I discovered there was a ruleset for WordPress (and WordPress VIP), it became something that I believe should be a necessary tool in every WordPress developer’s toolbox.
Depending on your IDE, you may or may not be able to install a plugin or an extension that will automatically monitor your code while you’re writing.
I made the change to Atom some time ago, which I’ll share more about momentarily, and it has excellent support for incorporating PHP CodeSniffer into your workflow.