diff vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/TInHookSchemaSniff.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/TInHookSchemaSniff.php	Tue Jul 10 15:07:59 2018 +0100
+++ b/vendor/drupal/coder/coder_sniffer/Drupal/Sniffs/Semantics/TInHookSchemaSniff.php	Thu Feb 28 13:21:36 2019 +0000
@@ -1,12 +1,18 @@
 <?php
 /**
- * Drupal_Sniffs_Semanitcs_TInHookSchemaSniff.
+ * \Drupal\Sniffs\Semantics\TInHookSchemaSniff.
  *
  * @category PHP
  * @package  PHP_CodeSniffer
  * @link     http://pear.php.net/package/PHP_CodeSniffer
  */
 
+namespace Drupal\Sniffs\Semantics;
+
+use Drupal\Sniffs\Semantics\FunctionDefinition;
+use PHP_CodeSniffer\Files\File;
+use PHP_CodeSniffer\Util\Tokens;
+
 /**
  * Checks that t() is not used in hook_schema().
  *
@@ -14,22 +20,22 @@
  * @package  PHP_CodeSniffer
  * @link     http://pear.php.net/package/PHP_CodeSniffer
  */
-class Drupal_Sniffs_Semantics_TInHookSchemaSniff extends Drupal_Sniffs_Semantics_FunctionDefinition
+class TInHookSchemaSniff 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(), -7));
         // Only check in *.install files.
@@ -52,7 +58,7 @@
         while ($string !== false) {
             if ($tokens[$string]['content'] === 't') {
                 $opener = $phpcsFile->findNext(
-                    PHP_CodeSniffer_Tokens::$emptyTokens,
+                    Tokens::$emptyTokens,
                     ($string + 1),
                     null,
                     true