Skip to content

Commit

Permalink
Fix error reporting for abstract naming sniff (#50)
Browse files Browse the repository at this point in the history
Previously the error message showed a placeholder rather than the class
name, like this:

    Abstract class name "%s" must be prefixed with "Abstract"

It now shows the class name, like this:

    Abstract class name "Foo" must be prefixed with "Abstract"
  • Loading branch information
biggianteye authored Aug 18, 2020
1 parent fb6c746 commit eac7737
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function process(File $phpcsFile, $stackPtr)
$className = $phpcsFile->getDeclarationName($stackPtr);

if (substr($className, 0, 8) !== 'Abstract') {
$phpcsFile->addError('Abstract class name "%s" must be prefixed with "Abstract"', $stackPtr, static::ERROR_CODE, '', [$className]);
$phpcsFile->addError('Abstract class name "%s" must be prefixed with "Abstract"', $stackPtr, static::ERROR_CODE, [$className]);
}
}
}
Expand Down

0 comments on commit eac7737

Please sign in to comment.