File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,17 @@ SPDX-License-Identifier: GPL-3.0-or-later AND MIT
5757
5858 <!-- === Rules ============================================================================= -->
5959
60+ <!-- Detect undefined and unused variables. -->
61+ <rule ref =" VariableAnalysis" />
62+ <rule ref =" VariableAnalysis.CodeAnalysis.VariableAnalysis" >
63+ <properties >
64+ <!-- <https://github.com/sirbrillig/phpcs-variable-analysis#:~:text=allowWordPressPassByRefFunctions> -->
65+ <property name =" allowWordPressPassByRefFunctions" value =" true" />
66+ <!-- Allow unused variables with the underscore prefix (e.g. `$_fnord`) -->
67+ <property name =" ignoreUnusedRegexp" value =" /^_/" />
68+ </properties >
69+ </rule >
70+
6071 <!--
6172 We are not hosted on WordPress VIP, but their standards generally reflect
6273 best practices in WordPress development. While the rules tend to reflect
Original file line number Diff line number Diff line change 88 "php" : " >=8.1" ,
99 "automattic/vipwpcs" : " ^3.0" ,
1010 "dealerdirect/phpcodesniffer-composer-installer" : " *" ,
11+ "sirbrillig/phpcs-variable-analysis" : " ^2.12" ,
1112 "slevomat/coding-standard" : " ^8.16.0" ,
1213 "squizlabs/php_codesniffer" : " ^3.7.2" ,
1314 "wp-coding-standards/wpcs" : " ^3.0"
You can’t perform that action at this time.
0 commit comments