Skip to content

Commit 94041d7

Browse files
authored
Merge pull request #205 from magento-commerce/imported-fredden-magento-coding-standard-426
[Imported] Fix PHP error with short class names
2 parents 5f4cb84 + 5a852b3 commit 94041d7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Magento2/Sniffs/Less/ClassNamingSniff.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function process(File $phpcsFile, $stackPtr)
6767
);
6868
}
6969

70-
if (strpos($className, self::STRING_HELPER_CLASSES_PREFIX, 2) !== false
70+
if (strlen($className) > 1 && strpos($className, self::STRING_HELPER_CLASSES_PREFIX, 2) !== false
7171
&& !str_starts_with($className, 'admin__')
7272
) {
7373
$phpcsFile->addError(

Magento2/Tests/Less/ClassNamingUnitTest.less

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@
3131
background: green;
3232
}
3333

34+
// @see https://github.com/magento/magento-coding-standard/issues/425
35+
.a {
36+
text-decoration: none;
37+
}
38+
3439
// @see https://github.com/magento/magento-coding-standard/issues/409
3540
.admin__allowed {
3641
background: green;

0 commit comments

Comments
 (0)