You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -175,10 +175,10 @@ More information is available in the [Upgrade Guide to WordPressCS 3.0.0 for Dev
175
175
-`WordPress-Core`: The `Generic.Files.EndFileNewline` sniff has been replaced by the more comprehensive `PSR2.Files.EndFileNewline` sniff.
176
176
- A number of sniffs support setting the minimum WP version for the code being scanned.
177
177
This could be done in two different ways:
178
-
1. By setting the `minimum_supported_version` property for each sniff from a ruleset.
179
-
2. By passing `--runtime-set minimum_supported_wp_version #.#` on the command line.
180
-
The names of the property and the CLI setting have now been aligned to both use `minimum_wp_version` as the name.
181
-
Both ways of passing the value are still supported.
178
+
1. By setting the `minimum_supported_version` property for each sniff from a ruleset.
179
+
2. By passing `--runtime-set minimum_supported_wp_version #.#` on the command line.
180
+
The names of the property and the CLI setting have now been aligned to both use `minimum_wp_version` as the name.
181
+
Both ways of passing the value are still supported.
182
182
-`WordPress.NamingConventions.PrefixAllGlobals`: the `custom_test_class_whitelist` property has been renamed to `custom_test_classes`.
183
183
-`WordPress.NamingConventions.ValidVariableName`: the `customPropertiesWhitelist` property has been renamed to `allowed_custom_properties`.
184
184
-`WordPress.PHP.NoSilencedErrors`: the `custom_whitelist` property has been renamed to `customAllowedFunctionsList`.
@@ -553,7 +553,7 @@ The move does not affect the package name for Packagist. This remains the same:
553
553
- New `Sniff::get_array_access_keys()` utility method to retrieve all array keys for a variable using multi-level array access.
554
554
- New `Sniff::is_class_object_call()`, `Sniff::is_token_namespaced()` utility methods.
555
555
These should help make the checking of whether or not a function call is a global function, method call or a namespaced function call more consistent.
556
-
This also implements allowing for the [namespace keyword being used as an operator](https://www.php.net/manual/en/language.namespaces.nsconstants.php#example-258).
556
+
This also implements allowing for the [namespace keyword being used as an operator](https://www.php.net/manual/en/language.namespaces.nsconstants.php#example-258).
557
557
- New `Sniff::is_in_function_call()` utility method to facilitate checking whether a token is (part of) a parameter passed to a specific (set of) function(s).
558
558
- New `Sniff::is_in_type_test()` utility method to determine if a variable is being type tested, along with a `Sniff::$typeTestFunctions` property containing the names of the functions this applies to.
559
559
- New `Sniff::is_in_array_comparison()` utility method to determine if a variable is (part of) a parameter in an array-value comparison, along with a `Sniff::$arrayCompareFunctions` property containing the names of the relevant functions.
@@ -666,7 +666,7 @@ If you are a maintainer of an external standard based on WordPressCS and any of
666
666
If you are referencing the old error code in a ruleset XML file or in inline annotations, you may need to update it.
667
667
- The `WordPress.NamingConventions.PrefixAllGlobals` sniff used the same error code for some errors as well as warnings.
668
668
The `NonPrefixedConstantFound` error code remains for the related error, but the warning will now use the new `VariableConstantNameFound` error code.
669
-
The `NonPrefixedHooknameFound` error code remains for the related error, but the warning will now use the new `DynamicHooknameFound` error code.
669
+
The `NonPrefixedHooknameFound` error code remains for the related error, but the warning will now use the new `DynamicHooknameFound` error code.
670
670
If you are referencing the old error codes in a ruleset XML file or in inline annotations, you may need to update these to use the new codes instead.
671
671
-`WordPress.NamingConventions.ValidVariableName`: the error messages and error codes used by this sniff have been changed for improved usability and consistency.
672
672
- The error messages will now show a suggestion for a valid alternative name for the variable.
@@ -694,7 +694,7 @@ If you are a maintainer of an external standard based on WordPressCS and any of
694
694
- Updated the [custom ruleset example](https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/phpcs.xml.dist.sample) to use the recommended ruleset syntax for `PHP_CodeSniffer` 3.3.1+, including using the new [array property format](https://github.com/PHPCSStandards/PHP_CodeSniffer/releases/tag/3.3.0) which is now supported.
695
695
- Dev: The command to run the unit tests has changed. Please see the updated instructions in the [CONTRIBUTING.md](https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/.github/CONTRIBUTING.md) file.
696
696
The `bin/pre-commit` example git hook has been updated to match. Additionally a `run-tests` script has been added to the `composer.json` file for your convenience.
697
-
To facilitate this, PHPUnit has been added to `require-dev`, even though it is strictly speaking a dependency of PHPCS, not of WPCS.
697
+
To facilitate this, PHPUnit has been added to `require-dev`, even though it is strictly speaking a dependency of PHPCS, not of WPCS.
698
698
- Dev: The [Composer PHPCS plugin] has been added to `require-dev`.
699
699
- Various code tweaks and clean up.
700
700
- User facing documentation, including the wiki, as well as inline documentation has been updated for all the changes contained in WordPressCS 2.0 and other recommended best practices for `PHP_CodeSniffer` 3.3.1+.
@@ -858,8 +858,8 @@ Note: This will be the last release supporting PHP_CodeSniffer 2.x.
858
858
* Allows for a used-defined list of (additional) function names to be passed to the sniff via the `custom_whitelist` property in a custom ruleset, for which - if the error control operator is detected in front of a function call to one of the functions in this whitelist - no warnings will be thrown.
859
859
* Displays a brief snippet of code in the `warning` message text to show the context in which the error control operator is being used. The length of the snippet (in tokens) can be customized via the `context_length` property.
860
860
* Contains a public `use_default_whitelist` property which can be set from a custom ruleset which regulates whether or not the standard whitelist of PHP functions should be used by the sniff.
861
-
The user-defined whitelist will always be respected.
862
-
By default, this property is set to `true` for the `WordPress-Core` ruleset and to `false` for the `WordPress-Extra` ruleset (which is stricter regarding these kind of best practices).
861
+
The user-defined whitelist will always be respected.
862
+
By default, this property is set to `true` for the `WordPress-Core` ruleset and to `false` for the `WordPress-Extra` ruleset (which is stricter regarding these kind of best practices).
863
863
- Metrics to the `WordPress.NamingConventions.PrefixAllGlobals` sniff to aid people in determining the most commonly used prefix in a legacy project.
864
864
For an example of how to use this feature, please see the detailed explanation in the [pull request](https://github.com/WordPress/WordPress-Coding-Standards/pull/1437).
0 commit comments