Skip to content

Commit 54cb911

Browse files
committed
Generic/TraitNameSuffix: add inline comment
This commit just adds an inline comment documenting why the sniff bails early if there is no trait name. Doing this to follow the same pattern used by other similar sniffs like AbstractClassName https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/8a7ee56347bb4017ffc778a42a532cbb1651a20b/src/Standards/Generic/Sniffs/NamingConventions/AbstractClassNamePrefixSniff.php#L48
1 parent d9b1b6e commit 54cb911

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Standards/Generic/Sniffs/NamingConventions/TraitNameSuffixSniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public function process(File $phpcsFile, $stackPtr)
4040
{
4141
$traitName = $phpcsFile->getDeclarationName($stackPtr);
4242
if ($traitName === null) {
43+
// Live coding or parse error. Bow out.
4344
return;
4445
}
4546

0 commit comments

Comments
 (0)