Skip to content

Installation

Nate Devereux edited this page Dec 7, 2023 · 6 revisions

💡 Note: this only needs to be done once. And may already have been done on your project

Steps

  1. import dependency with composer require
composer require --dev silverstripeltd/bespoke-standards
  1. ensure slevomat/coding-standard and php-parallel-lint/php-parallel-lint are removed from your projects dependencies.
composer remove --dev slevomat/coding-standard
composer remove --dev php-parallel-lint/php-parallel-lint
  1. Update the associated scripts in the composer.json's script section to use the new commands
    Be mindful of all references you might need to update (i.e. circleCI configs, script that reference others, etc)
    Your final file may look something like the one below
{
  "scripts": {
      "silverstripe-standards": [
          "@php-lint",
          "@phpcs",
          "yarn lint",
          "yarn prettier:check" // if you have prettier etc
      ],
      "php-lint": "bespoke-phplint",
      "phpcs": "bespoke-phpcs",
      "phpcbf": "bespoke-phpcbf",
      "phpcs-fix": "@phpcbf",
  }
}
  1. Remove your root level phpcs.xml if it exists and start using the Silverstripe Bespoke Standards 🎉

If there are standards you wish to keep, or its too large of a change in one go read the Overriding rulesets page to learn about more.

Clone this wiki locally