Every developer worth his or her weight will say writing quality code is key to making sure a project is maintainable over time.
What constitutes quality code may be subjective and this is not the post to debate that; however, if you’re working with PHP – especially alongside MAMP and WordPress – then I think using the PHP CodeSniffer is a tool we should all be using.
For those who’ve written both PHP applications and WordPress-specific applications, you know there are different standards used for writing code. Since this blog is primarily focused on the latter, then I’m obviously going to be focusing on that, but the steps provided aren’t altogether different for working strictly with PHP.
So here’s how you can setup PHP CodeSniffer, the rules for the WordPress Coding Standards, and how to have them run alongside MAMP.