Skip to content

Commit 52356b9

Browse files
author
Nikolay Shapovalov
committed
move
1 parent 5449fd4 commit 52356b9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

coder_sniffer/DrupalPractice/Sniffs/General/AttributeHookNoHookPrefix.php renamed to coder_sniffer/Drupal/Sniffs/NamingConventions/ValidAttributeHookNameSniff.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22
/**
3-
* \Drupal\Sniffs\General\AttributeHookNoHookPrefix.
3+
* \Drupal\Sniffs\NamingConventions\ValidAttributeHookNameSniff.
44
*
55
* @category PHP
66
* @package PHP_CodeSniffer
77
* @link http://pear.php.net/package/PHP_CodeSniffer
88
*/
99

10-
namespace DrupalPractice\Sniffs\General;
10+
namespace Drupal\Sniffs\NamingConventions;
1111

1212
use PHP_CodeSniffer\Files\File;
1313
use PHP_CodeSniffer\Sniffs\Sniff;
@@ -19,7 +19,7 @@
1919
* @package PHP_CodeSniffer
2020
* @link http://pear.php.net/package/PHP_CodeSniffer
2121
*/
22-
class AttributeHookNoHookPrefix implements Sniff
22+
class ValidAttributeHookNameSniff implements Sniff
2323
{
2424

2525

@@ -59,7 +59,7 @@ public function process(File $phpcsFile, $stackPtr)
5959
&& str_contains($tokens[$stackPtr + 3]['content'], 'hook_')
6060
) {
6161
$hookName = $tokens[$stackPtr + 3]['content'];
62-
$phpcsFile->addFixableWarning('Hook name should not start with "hook_" prefix. Hook name used:' . $hookName, $stackPtr + 3,'HookAttributePrefixName');
62+
$phpcsFile->addFixableWarning('Hook name should not start with "hook_" prefix. Hook name used:' . $hookName, $stackPtr + 3,'AttributePrefixHookName');
6363
$phpcsFile->fixer->replaceToken($stackPtr + 3, str_replace('hook_', '', $hookName));
6464
}
6565

0 commit comments

Comments
 (0)