Skip to content

Commit be4062c

Browse files
authored
Composer: PHPCS is a production dependency (#40)
PHP_CodeSniffer is a dependency for this external standard to be able to run, so should be in `require`, not `require-dev`. This also makes sure that people won't be able to try and run the standard with incompatible PHPCS versions. Includes making the version requirement more flexible (not fixed to one version `3.3.0` only). Co-authored-by: jrfnl <[email protected]>
1 parent 14e580d commit be4062c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ class Car {
3232
To use these rules in a project which is set up using [composer](https://href.li/?https://getcomposer.org/), we recommend using the [phpcodesniffer-composer-installer library](https://href.li/?https://github.com/DealerDirect/phpcodesniffer-composer-installer) which will automatically use all installed standards in the current project with the composer type `phpcodesniffer-standard` when you run phpcs.
3333

3434
```
35-
composer require --dev squizlabs/php_codesniffer dealerdirect/phpcodesniffer-composer-installer
36-
composer require --dev sirbrillig/phpcs-import-detection
35+
composer require --dev sirbrillig/phpcs-import-detection dealerdirect/phpcodesniffer-composer-installer
3736
```
3837

3938
## Configuration

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
"test": "./vendor/bin/phpunit"
2121
},
2222
"require" : {
23-
"php" : "^7.0"
23+
"php" : "^7.0",
24+
"squizlabs/php_codesniffer": "^3.3.0"
2425
},
2526
"require-dev": {
2627
"sirbrillig/phpcs-variable-analysis": "^2.0.1",
2728
"dealerdirect/phpcodesniffer-composer-installer": "^0.6",
2829
"phpunit/phpunit": "^6.4",
29-
"limedeck/phpunit-detailed-printer": "^3.1",
30-
"squizlabs/php_codesniffer": "3.3.0"
30+
"limedeck/phpunit-detailed-printer": "^3.1"
3131
}
3232
}

0 commit comments

Comments
 (0)