Skip to content

Commit 452693f

Browse files
committed
simpler regex
1 parent 7ea70d0 commit 452693f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

coder_sniffer/Drupal/Sniffs/NamingConventions/ValidClassNameSniff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ public function process(File $phpcsFile, $stackPtr)
7474

7575
// Ensure the name is not all uppercase.
7676
// @todo We could make this more strict to check if there are more than
77-
// 2 upper case characters in a row, but not decided yet.
77+
// 2 upper case characters in a row anywhere, but not decided yet.
7878
// See https://www.drupal.org/project/coder/issues/3497433
79-
if (preg_match('|^[A-Z]{3}[A-Z_]*$|', $name) === 1) {
79+
if (preg_match('|^[A-Z]{3}|', $name) === 1) {
8080
$error = '%s name must use UpperCamel naming and not contain multiple upper case letters in a row';
8181
$phpcsFile->addError($error, $stackPtr, 'NoUpperAcronyms', $errorData);
8282
}

0 commit comments

Comments
 (0)