Skip to content

Commit

Permalink
Composer: move PHPCS dependency to require (#106)
Browse files Browse the repository at this point in the history
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 ?
  • Loading branch information
jrfnl authored and sirbrillig committed Jan 17, 2020
1 parent 822db6b commit 5081118
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Plugin for PHP_CodeSniffer static analysis tool that adds analysis of problemati

### Requirements

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

### With PHPCS Composer Installer

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
"phpstan": "./vendor/bin/phpstan analyse -l 7 VariableAnalysis"
},
"require" : {
"php" : ">=5.6.0"
"php" : ">=5.6.0",
"squizlabs/php_codesniffer": "^3.1"
},
"require-dev": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.4",
"phpunit/phpunit": "^6.5",
"sirbrillig/phpcs-import-detection": "^1.1",
"squizlabs/php_codesniffer": "^3.1",
"limedeck/phpunit-detailed-printer": "^3.1",
"phpstan/phpstan": "^0.11.8"
}
Expand Down

0 comments on commit 5081118

Please sign in to comment.