Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions WordPress-Extra/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
</rule>

<!-- Duplicate of upstream. Can be removed once minimum PHPCS requirement has gone up.
https://github.com/squizlabs/PHP_CodeSniffer/pull/1594 -->
https://github.com/squizlabs/PHP_CodeSniffer/pull/1594
Note: the "assignment in ternary" part of the sniff is currently not yet covered in
the upstream version. This needs to be pulled first before we can defer to upstream. -->
<rule ref="WordPress.CodeAnalysis.AssignmentInCondition"/>

<!-- More generic PHP best practices.
Expand Down Expand Up @@ -145,7 +147,14 @@
<rule ref="WordPress.NamingConventions.PrefixAllGlobals"/>

<!-- Check that object instantiations always have braces & are not assigned by reference.
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/919 -->
https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/919
Note: there is a similar upstream sniff `PSR12.Classes.ClassInstantiation`, however
that sniff:
- does not cover JS files;
- does not demand parentheses for PHP anonymous classes;
- does not check the whitespace between the class name and the parentheses;
- does not check for PHP new by reference.
For those reasons, the WPCS version should remain. -->
<rule ref="WordPress.Classes.ClassInstantiation"/>

<!-- https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/1157 -->
Expand Down