Skip to content

Commit 47bc595

Browse files
committed
more lenient
1 parent 452693f commit 47bc595

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

coder_sniffer/Drupal/Sniffs/NamingConventions/ValidClassNameSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function process(File $phpcsFile, $stackPtr)
7676
// @todo We could make this more strict to check if there are more than
7777
// 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}|', $name) === 1) {
79+
if (preg_match('|^[A-Z]{3}[A-Z_0-9]*$|', $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
}

tests/Drupal/NamingConventions/ValidEnumCaseUnitTest.inc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ enum Test: int {
1010
// Upper case parts are allowed for now.
1111
case FourJSONCase = 4;
1212
case FiveAndAHorseCorrect = 5;
13+
case UIExample = 6;
1314
}
1415

1516
// Those are all ok.

0 commit comments

Comments
 (0)