Skip to content

Commit 253a1fc

Browse files
committed
Use two new sniffs from PHPCSExtra 1.2.0
PHPCSExtra 1.2.0 was released yesterday and contains two new sniffs which IMO would be suitable for adding to WordPressCS. Includes raising the minimum supported PHPCSExtra version. (will conflict with PR 2408 and will need rebase depending on which is merged first) Ref: * https://github.com/PHPCSStandards/PHPCSExtra/releases/tag/1.2.0
1 parent fe78958 commit 253a1fc

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ When you introduce new `public` sniff properties, or your sniff extends a class
4141
* WordPress-Coding-Standards
4242
* PHP_CodeSniffer 3.7.2 or higher
4343
* PHPCSUtils 1.0.8 or higher
44-
* PHPCSExtra 1.1.0 or higher
44+
* PHPCSExtra 1.2.0 or higher
4545
* PHPUnit 4.x, 5.x, 6.x or 7.x
4646

4747
The WordPress Coding Standards use the `PHP_CodeSniffer` native unit test framework for unit testing the sniffs.

WordPress-Core/ruleset.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -869,6 +869,9 @@
869869
<!-- Important to prevent issues with content being sent before headers. -->
870870
<rule ref="Generic.Files.ByteOrderMark"/>
871871

872+
<!-- Always have a lowertag PHP open tag. -->
873+
<rule ref="Universal.PHP.LowercasePHPTag"/>
874+
872875
<!-- All line endings should be \n. -->
873876
<rule ref="Generic.Files.LineEndings">
874877
<properties>

WordPress-Extra/ruleset.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@
180180
<!-- Detect useless "echo sprintf(...)". -->
181181
<rule ref="Universal.CodeAnalysis.NoEchoSprintf"/>
182182

183+
<!-- Detect use of double negative `!!`. -->
184+
<rule ref="Universal.CodeAnalysis.NoDoubleNegative"/>
185+
183186
<!--
184187
#############################################################################
185188
Code style sniffs for more recent PHP features and syntaxes.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"ext-xmlreader": "*",
2424
"squizlabs/php_codesniffer": "^3.7.2",
2525
"phpcsstandards/phpcsutils": "^1.0.8",
26-
"phpcsstandards/phpcsextra": "^1.1.0"
26+
"phpcsstandards/phpcsextra": "^1.2.0"
2727
},
2828
"require-dev": {
2929
"phpcompatibility/php-compatibility": "^9.0",

0 commit comments

Comments
 (0)