Skip to content

Instantly share code, notes, and snippets.

@jaredatch
Created February 12, 2018 18:06
Show Gist options
  • Save jaredatch/516a633f4e23ba3463e353616237fd1f to your computer and use it in GitHub Desktop.
Save jaredatch/516a633f4e23ba3463e353616237fd1f to your computer and use it in GitHub Desktop.
Install PHPCS with MAMP Pro

Install PHPCS with MAMP Pro

PHPCS

There are different ways to install PHPCS, the method below uses PEAR which installs it within your PHP installation.

First, locate the active MAMP Pro PHP installation.

$ which php

It will return something similar to /Applications/MAMP/bin/php/php7.2.1/bin/php. Go to the bin directory.

$ pear install PHP_CodeSniffer

That will install PHPCS. 💥

As I bonus, configure it to work with WPCS (which has been already downloaded)

$ phpcs --config-set installed_paths ~/.scripts/wpcs

Notes:

When MAMP updates are installed, they generally include updated versions of PHP. So make a note that when you update MAMP (or if you toggle between PHP versions) you will need to reinstall PHPCS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment