From 869a7e2913f3469a63c50988ceb3e3f59c26be0f Mon Sep 17 00:00:00 2001 From: jrfnl Date: Wed, 15 Jan 2020 18:55:54 +0100 Subject: [PATCH] Composer: move PHPCS dependency to `require` 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 ? --- README.md | 2 +- composer.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4b80fa05..cdfa2cab 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/composer.json b/composer.json index c7ec8443..dfe8bea7 100644 --- a/composer.json +++ b/composer.json @@ -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" }