diff --git a/WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml b/WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml index 2da45692c..bb518dbda 100644 --- a/WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml +++ b/WordPress/Docs/NamingConventions/PrefixAllGlobalsStandard.xml @@ -101,7 +101,7 @@ function wp_save_post() {} diff --git a/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php b/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php index 621ddb08a..3f213ab47 100644 --- a/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php +++ b/WordPress/Sniffs/NamingConventions/PrefixAllGlobalsSniff.php @@ -58,13 +58,15 @@ final class PrefixAllGlobalsSniff extends AbstractFunctionParameterSniff { /** * Minimal number of characters the prefix needs in order to be valid. * + * @since 3.2.0 The minimum number of characters was raised from 3 to 4. * @since 2.2.0 * * @link https://github.com/WordPress/WordPress-Coding-Standards/issues/1733 Issue 1733. + * @link https://github.com/WordPress/WordPress-Coding-Standards/issues/2467 Issue 2467. * * @var int */ - const MIN_PREFIX_LENGTH = 3; + const MIN_PREFIX_LENGTH = 4; /** * Target prefixes. diff --git a/WordPress/Tests/NamingConventions/PrefixAllGlobalsUnitTest.1.inc b/WordPress/Tests/NamingConventions/PrefixAllGlobalsUnitTest.1.inc index cdbe22dbc..842aa1a27 100644 --- a/WordPress/Tests/NamingConventions/PrefixAllGlobalsUnitTest.1.inc +++ b/WordPress/Tests/NamingConventions/PrefixAllGlobalsUnitTest.1.inc @@ -6,8 +6,8 @@ // phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] wp function wp_do_something() {} -// phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] ^%& -function ^%&_do_something() {} +// phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] ^%&% +function ^%&%_do_something() {} // Now let's set the real prefixes we want to test for. // phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] acronym,tgmpa @@ -511,13 +511,13 @@ function aa_do_something(){} // The following line mimics an empty prefix value. // phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] , -function aaa_do_something(){} +function aaaa_do_something(){} // phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] 😊 function 😊_do_something(){} -// phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] 😊😊 -function 😊😊_do_something(){} +// phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] 😊😊😊 +function 😊😊😊_do_something(){} // Reset to the standard test prefixes. // phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] acronym,tgmpa