From eac7737b0ca12c31d98987c981ce39448dd789c8 Mon Sep 17 00:00:00 2001 From: Burhan Ali <1482649+biggianteye@users.noreply.github.com> Date: Tue, 18 Aug 2020 16:43:31 +0100 Subject: [PATCH] Fix error reporting for abstract naming sniff (#50) 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" --- .../Graze/Sniffs/Naming/AbstractClassNamingSniff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PHP/CodeSniffer/Graze/Sniffs/Naming/AbstractClassNamingSniff.php b/PHP/CodeSniffer/Graze/Sniffs/Naming/AbstractClassNamingSniff.php index 2a58aba..9e84100 100644 --- a/PHP/CodeSniffer/Graze/Sniffs/Naming/AbstractClassNamingSniff.php +++ b/PHP/CodeSniffer/Graze/Sniffs/Naming/AbstractClassNamingSniff.php @@ -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]); } } }