A little over a month ago, I talked about how to install the PHP Code Sniffer in an MAMP-based environment. Though you can read the post in its entirety, the short of is this:
- Setup Pear
- Install the package via Pear
- Grab the rules for the WordPress Coding Standards
- Begin evaluating your code
Easy enough, right?
But here’s the thing: As mentioned in the article, some may opt to use Composer to install the package. In fact, someone also mentioned this in the comments.
And since Composer is the default dependency management application for PHP projects, it makes sense to use it, right?

The funny thing is, since I’ve written that article, I’ve been using Composer in a few projects. So I thought it would make sense to show how to install PHP CodeSniffer with Composer.



