File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed
Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ function <em>wp_save_post()</em> {}
101101 </code_comparison >
102102 <standard >
103103 <![CDATA[
104- Prefixes must have a minimum length of three character to be considered valid, as many plugins and themes share the same initials.
104+ Prefixes must have a minimum length of four character to be considered valid, as many plugins and themes share the same initials.
105105 ]]>
106106 </standard >
107107 <code_comparison >
Original file line number Diff line number Diff line change @@ -59,12 +59,14 @@ final class PrefixAllGlobalsSniff extends AbstractFunctionParameterSniff {
5959 * Minimal number of characters the prefix needs in order to be valid.
6060 *
6161 * @since 2.2.0
62+ * @since 3.2.0 The minimum number of characters was raised from 3 to 4.
6263 *
6364 * @link https://github.com/WordPress/WordPress-Coding-Standards/issues/1733 Issue 1733.
65+ * @link https://github.com/WordPress/WordPress-Coding-Standards/issues/2467 Issue 2467.
6466 *
6567 * @var int
6668 */
67- const MIN_PREFIX_LENGTH = 3 ;
69+ const MIN_PREFIX_LENGTH = 4 ;
6870
6971 /**
7072 * Target prefixes.
Original file line number Diff line number Diff line change 66// phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] wp
77function wp_do_something () {}
88
9- // phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] ^%&
10- function ^%&_do_something () {}
9+ // phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] ^%&%
10+ function ^%&% _do_something () {}
1111
1212// Now let's set the real prefixes we want to test for.
1313// phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] acronym,tgmpa
@@ -511,13 +511,13 @@ function aa_do_something(){}
511511
512512// The following line mimics an empty prefix value.
513513// phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] ,
514- function aaa_do_something (){}
514+ function aaaa_do_something (){}
515515
516516// phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] 😊
517517function 😊_do_something (){}
518518
519- // phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] 😊😊
520- function 😊😊_do_something (){}
519+ // phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] 😊😊😊
520+ function 😊😊😊 _do_something (){}
521521
522522// Reset to the standard test prefixes.
523523// phpcs:set WordPress.NamingConventions.PrefixAllGlobals prefixes[] acronym,tgmpa
You can’t perform that action at this time.
0 commit comments