File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
WordPress/Sniffs/NamingConventions Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -925,15 +925,12 @@ private function validate_prefixes() {
925925 continue ;
926926 }
927927
928- if ( function_exists ( 'iconv_strlen ' ) && iconv_strlen ( $ prefix , $ this ->phpcsFile ->config ->encoding ) < self ::MIN_PREFIX_LENGTH ) {
929- $ this ->phpcsFile ->addError (
930- 'The "%s" prefix is too short. Short prefixes are not unique enough and may cause name collisions with other code. ' ,
931- 0 ,
932- 'ShortPrefixPassed ' ,
933- array ( $ prefix )
934- );
935- continue ;
936- } elseif ( ! function_exists ( 'iconv_strlen ' ) && strlen ( $ prefix , $ this ->phpcsFile ->config ->encoding ) < self ::MIN_PREFIX_LENGTH ) {
928+ $ prefix_length = strlen ( $ prefix );
929+ if ( function_exists ( 'iconv_strlen ' ) ) {
930+ $ prefix_length = iconv_strlen ( $ prefix , $ this ->phpcsFile ->config ->encoding );
931+ }
932+
933+ if ( $ prefix_length < self ::MIN_PREFIX_LENGTH ) {
937934 $ this ->phpcsFile ->addError (
938935 'The "%s" prefix is too short. Short prefixes are not unique enough and may cause name collisions with other code. ' ,
939936 0 ,
You can’t perform that action at this time.
0 commit comments