Chris@0: getTokens(); Chris@0: Chris@0: $varToken = $stackPtr; Chris@0: // Find variable names until we hit a semicolon. Chris@17: $ignore = Tokens::$emptyTokens; Chris@0: $ignore[] = T_SEMICOLON; Chris@0: while (($varToken = $phpcsFile->findNext($ignore, ($varToken + 1), null, true, null, true)) !== false) { Chris@0: if ($tokens[$varToken]['code'] === T_VARIABLE Chris@0: && in_array($tokens[$varToken]['content'], $this->coreGlobals) === false Chris@0: && $tokens[$varToken]['content']{1} !== '_' Chris@0: ) { Chris@0: $error = 'global variables should start with a single underscore followed by the module and another underscore'; Chris@0: $phpcsFile->addError($error, $varToken, 'GlobalUnderScore'); Chris@0: } Chris@0: } Chris@0: Chris@0: }//end process() Chris@0: Chris@0: Chris@0: }//end class