Skip to content

Change `composer.json` "type" to `phpcodesniffer standard`

Juliette edited this page May 6, 2020 · 4 revisions

Problem/Motivation

Composer allows declaring the type of a package. When no type is declared, the default is "library".

There are various composer plugins that can install custom PHP CodeSniffer standards:

For these installers to work, the package type needs to be set to "phpcodesniffer-standard".

There are also a lot of packages that adhere to this type.

Proposed changes

Adding the following line to the composer.json will make it possible for such packages to install this custom code-standard using composer:

    "type" : "phpcodesniffer-standard"

This will in no way change the existing behaviour of this package for users that do not include one of the packages mentioned above in their projects composer.json.