Skip to content

Commit 5081118

Browse files
jrfnlsirbrillig
authored andcommitted
Composer: move PHPCS dependency to require (#106)
PHPCS is a direct dependency for this utility to be run, so should be in `require`. The problem with not having it there is that other external /project rulesets may have different PHPCS requirements and Composer will not be able to take the requirements for this project into consideration when doing the version negotiations unless the dependency is explicitly set in `require`. Relying on PHPCS being installed with the DealerDirect plugin is not stable as they may change their minimum required PHPCS version without notice. As the minimum version in the `composer.json` file and the one in the `README` were not in line (though very close), I've also updated the minimum required version as mentioned in the `README` to be in line. Question: as the Composer install instructions already suggest using the DealerDirect plugin, why not make that a `no-dev` requirement as well ?
1 parent 822db6b commit 5081118

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Plugin for PHP_CodeSniffer static analysis tool that adds analysis of problemati
1212

1313
### Requirements
1414

15-
VariableAnalysis requires PHP 5.6 or higher and [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) version **3.0.2** or higher.
15+
VariableAnalysis requires PHP 5.6 or higher and [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) version **3.1.0** or higher.
1616

1717
### With PHPCS Composer Installer
1818

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@
3535
"phpstan": "./vendor/bin/phpstan analyse -l 7 VariableAnalysis"
3636
},
3737
"require" : {
38-
"php" : ">=5.6.0"
38+
"php" : ">=5.6.0",
39+
"squizlabs/php_codesniffer": "^3.1"
3940
},
4041
"require-dev": {
4142
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
4243
"phpunit/phpunit": "^6.5",
4344
"sirbrillig/phpcs-import-detection": "^1.1",
44-
"squizlabs/php_codesniffer": "^3.1",
4545
"limedeck/phpunit-detailed-printer": "^3.1",
4646
"phpstan/phpstan": "^0.11.8"
4747
}

0 commit comments

Comments
 (0)