Skip to content

Commit 17cc585

Browse files
authored
Merge pull request #2409 from WordPress/feature/phpcsextra-1.2.0-sniffs
Use two new sniffs from PHPCSExtra 1.2.0
2 parents fe78958 + 253a1fc commit 17cc585

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

.github/CONTRIBUTING.md

+1-1
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

+3
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

+3
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

+1-1
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)