Mercurial > hg > isophonics-drupal-site
diff vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/TInHookMenuSniff.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children |
line wrap: on
line diff
--- a/vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/TInHookMenuSniff.php Tue Jul 10 15:07:59 2018 +0100 +++ b/vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/TInHookMenuSniff.php Thu Feb 28 13:21:36 2019 +0000 @@ -1,12 +1,17 @@ <?php /** - * Drupal_Sniffs_Semanitcs_TInHookMenuSniff. + * \Drupal\Sniffs\Semantics\TInHookMenuSniff. * * @category PHP * @package PHP_CodeSniffer * @link http://pear.php.net/package/PHP_CodeSniffer */ +namespace Drupal\Sniffs\Semantics; + +use PHP_CodeSniffer\Files\File; +use PHP_CodeSniffer\Util\Tokens; + /** * Checks that t() is not used in hook_menu(). * @@ -14,22 +19,22 @@ * @package PHP_CodeSniffer * @link http://pear.php.net/package/PHP_CodeSniffer */ -class Drupal_Sniffs_Semantics_TInHookMenuSniff extends Drupal_Sniffs_Semantics_FunctionDefinition +class TInHookMenuSniff extends FunctionDefinition { /** * Process this function definition. * - * @param PHP_CodeSniffer_File $phpcsFile The file being scanned. - * @param int $stackPtr The position of the function name in the stack. - * name in the stack. - * @param int $functionPtr The position of the function keyword in the stack. - * keyword in the stack. + * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned. + * @param int $stackPtr The position of the function name in the stack. + * name in the stack. + * @param int $functionPtr The position of the function keyword in the stack. + * keyword in the stack. * * @return void */ - public function processFunction(PHP_CodeSniffer_File $phpcsFile, $stackPtr, $functionPtr) + public function processFunction(File $phpcsFile, $stackPtr, $functionPtr) { $fileExtension = strtolower(substr($phpcsFile->getFilename(), -6)); // Only check in *.module files. @@ -52,7 +57,7 @@ while ($string !== false) { if ($tokens[$string]['content'] === 't') { $opener = $phpcsFile->findNext( - PHP_CodeSniffer_Tokens::$emptyTokens, + Tokens::$emptyTokens, ($string + 1), null, true