Skip to content

Instantly share code, notes, and snippets.

@jaredatch
Created February 12, 2018 18:06
Show Gist options
  • Select an option

  • Save jaredatch/516a633f4e23ba3463e353616237fd1f to your computer and use it in GitHub Desktop.

Select an option

Save jaredatch/516a633f4e23ba3463e353616237fd1f to your computer and use it in GitHub Desktop.

Revisions

  1. jaredatch created this gist Feb 12, 2018.
    30 changes: 30 additions & 0 deletions phpcs-mamp.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    # Install PHPCS with MAMP Pro

    [PHPCS](https://github.com/squizlabs/PHP_CodeSniffer)

    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.