Skip to content
This repository was archived by the owner on May 29, 2021. It is now read-only.

Upgrade Guide

Aubrey Portwood edited this page Feb 14, 2020 · 7 revisions

If you are planning on using php-coding-standards and have previously used WDS-Coding-Standards, please follow this guide to upgrade your setup.


Remove WDS-Coding-Standards

If you previously installed WDS-Coding-Standards is deprecated, to uninstall:

composer global remove webdevstudios/wds-coding-standards

This will disable all your JS, PHP, and SASS linting though, so please also see upgrade guides for js-coding-standards and css-coding-standards. You will also need to setup js-coding-standards and css-coding-standards.


Remove phpcs if it's installed globally

If you have phpcs installed via composer globally, you may want to remove it via:

composer global remove squizlabs/php_codesniffer

Note, you do not need to do this step, e.g. if you are running other standards globally, but it will reduce conflicts when installing. If you are not running any other standards other than WordPress and WebDevStudios, I recommend you follow this step.

You can find out what standards you are using by:

~/.composer/vendor/bin/phpcs -i

Then install using steps found here.


Editor Configuration

If you're coming from WDS-Coding-Standards, you likely have it configured for your global setup. For instance, in Sublime Text 3's phpcs package, it looks like this:

      "phpcs": {
          "disable": false,
          "executable": "~/.composer/vendor/bin/phpcs",
          "args": [
              "--standard=WebDevStudios"
          ],
          "excludes": [],
      },

You'll want to disable both the executable path and your --standard setting:

      "phpcs": {
          "disable": false,
          "args": [
          ],
          "excludes": [],
      },

This will allow your editor to detect the phpcs executable in your project, and use the standard automatically set when you install it.

Clone this wiki locally