Skip to content

Commit 2966699

Browse files
author
Nikolay Shapovalov
committed
use addFixableWarning
1 parent f5ef016 commit 2966699

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

coder_sniffer/Drupal/Sniffs/Classes/TestSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function process(File $phpcsFile, $stackPtr)
6565
&& str_contains($tokens[$stackPtr + 3]['content'], 'hook_')
6666
) {
6767
$hookName = $tokens[$stackPtr + 3]['content'];
68-
$phpcsFile->addWarning('Hook name should not start with "hook_" prefix. Hook name used:' . $hookName, $stackPtr + 3,'HookAttributePrefixName');
68+
$phpcsFile->addFixableWarning('Hook name should not start with "hook_" prefix. Hook name used:' . $hookName, $stackPtr + 3,'HookAttributePrefixName');
6969
$phpcsFile->fixer->replaceToken($stackPtr + 3, str_replace('hook_', '', $hookName));
7070
}
7171

0 commit comments

Comments
 (0)