Skip to content

Commit 1f09a46

Browse files
committed
PHPCS: Update ruleset to exclude classes from PrefixAllGlobals.NonPrefixedClassFound sniff
Fix CS in User commands
1 parent c528826 commit 1f09a46

File tree

5 files changed

+194
-160
lines changed

5 files changed

+194
-160
lines changed

phpcs.xml.dist

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,16 @@
5151
</properties>
5252
</rule>
5353

54+
<!-- Exclude existing classes from the prefix rule as it would break BC to prefix them now. -->
5455
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedNamespaceFound">
5556
<exclude-pattern>*/src/WP_CLI/Fetchers/(Comment|Post|Site|User)\.php$</exclude-pattern>
5657
<exclude-pattern>*/src/WP_CLI/CommandWith(DBObject|Meta|Terms)\.php$</exclude-pattern>
5758
</rule>
5859

60+
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound">
61+
<exclude-pattern>*/src/User(_Meta|_Session|_Term)?_Command\.php$</exclude-pattern>
62+
</rule>
63+
5964
<!-- Whitelisting to provide backward compatibility to classes possibly extending this class. -->
6065
<rule ref="PSR2.Methods.MethodDeclaration.Underscore">
6166
<exclude-pattern>*/src/WP_CLI/CommandWithDBObject\.php$</exclude-pattern>

0 commit comments

Comments
 (0)