From 4682b18cd21072d22b9909b28179b9c440ac5f1d Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sat, 28 Jan 2017 13:27:12 +0100 Subject: [PATCH] Enable the `Generic.CodeAnalysis.UnusedFunctionParameter` sniff. The reason why the sniff was disabled up to now was that WP uses callbacks a lot and the hooked in functions may not use all parameters passed to them. This concern was previously raised in https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/pull/382#discussion_r29981655 To this end, I've send in a PR upstream to address these concerns, which has subsequently been merged. The adjusted version of the sniff will be released in PHPCS 2.7.2. --- .travis.yml | 2 +- README.md | 2 +- WordPress-Extra/ruleset.xml | 11 ++++++++--- composer.json | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 55a446bd47..0aa53a2eec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ php: env: - PHPCS_BRANCH=master - - PHPCS_BRANCH=2.7.1 + - PHPCS_BRANCH=2.7.2 matrix: fast_finish: true diff --git a/README.md b/README.md index ee0ac38655..323ba09f2f 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ This project is a collection of [PHP_CodeSniffer](https://github.com/squizlabs/P ### Requirements -The WordPress Coding Standards require the [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) version **2.7.0** or higher. +The WordPress Coding Standards require the [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) version **2.7.2** or higher. The WordPress Coding Standards are currently [not compatible with the upcoming PHPCS 3 release](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/718). ### Composer diff --git a/WordPress-Extra/ruleset.xml b/WordPress-Extra/ruleset.xml index 9c436d304c..9272c89715 100644 --- a/WordPress-Extra/ruleset.xml +++ b/WordPress-Extra/ruleset.xml @@ -36,9 +36,14 @@ - - - + + + + + + + diff --git a/composer.json b/composer.json index afe45a1b07..f219bb1b11 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,7 @@ } ], "require" : { - "squizlabs/php_codesniffer": "^2.7" + "squizlabs/php_codesniffer": "^2.7.2" }, "minimum-stability" : "RC", "support" : {