Skip to content

Commit

Permalink
Generic/InterfaceNameSuffix: add inline comment
Browse files Browse the repository at this point in the history
This commit just adds an inline comment documenting why the sniff bails
early if there is no interface 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
  • Loading branch information
rodrigoprimo committed Oct 29, 2024
1 parent e84d732 commit 2b7a230
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public function process(File $phpcsFile, $stackPtr)
{
$interfaceName = $phpcsFile->getDeclarationName($stackPtr);
if ($interfaceName === null) {
// Live coding or parse error. Bow out.
return;
}

Expand Down

0 comments on commit 2b7a230

Please sign in to comment.