protected function processVariableInString(
        PHP_CodeSniffer_File
        $phpcsFile,
        $stackPtr
    ) {
        $tokens = $phpcsFile->getTokens();
        $token  = $tokens[$stackPtr];

        if (!preg_match_all($this->_double_quoted_variable_regexp, $token['content'], $matches)) {
            return;
        }

        $currScope = $this->findVariableScope($phpcsFile, $stackPtr);
        foreach ($matches[1] as $varName) {
            $varName = $this->normalizeVarName($varName);
            // Are we $this within a class?
            if ($this->checkForThisWithinClass($phpcsFile, $stackPtr, $varName, $currScope)) {
                continue;
            }
            if ($this->checkForSuperGlobal($phpcsFile, $stackPtr, $varName, $currScope)) {
                continue;
            }
            $this->markVariableReadAndWarnIfUndefined($phpcsFile, $varName, $stackPtr, $currScope);
        }
    }
protected function processVariableInString(
        PHP_CodeSniffer_File
        $phpcsFile,
        $stackPtr
    ) {
        $tokens = $phpcsFile->getTokens();
        $token  = $tokens[$stackPtr];

        if (!preg_match_all($this->_double_quoted_variable_regexp, $token['content'], $matches)) {
            return;
        }

        $currScope = $this->findVariableScope($phpcsFile, $stackPtr);
        foreach ($matches[1] as $varName) {
            $varName = $this->normalizeVarName($varName);
            // Are we $this within a class?
            if ($this->checkForThisWithinClass($phpcsFile, $stackPtr, $varName, $currScope)) {
                continue;
            }
            if ($this->checkForSuperGlobal($phpcsFile, $stackPtr, $varName, $currScope)) {
                continue;
            }
            $this->markVariableReadAndWarnIfUndefined($phpcsFile, $varName, $stackPtr, $currScope);
        }
    }
protected function processVariableInString ( PHP_CodeSniffer_File $ phpcsFile , $ stackPtr ) { $ tokens = $ phpcsFile -> getTokens ( ) ; $ token = $ tokens [ $ stackPtr ] ; if ( ! preg_match_all ( $ this -> _double_quoted_variable_regexp , $ token [ 'content' ] , $ matches ) ) { return ; } $ currScope = $ this -> findVariableScope ( $ phpcsFile , $ stackPtr ) ; foreach ( $ matches [ 1 ] as $ varName ) { $ varName = $ this -> normalizeVarName ( $ varName ) ; // Are we $this within a class? if ( $ this -> checkForThisWithinClass ( $ phpcsFile , $ stackPtr , $ varName , $ currScope ) ) { continue ; } if ( $ this -> checkForSuperGlobal ( $ phpcsFile , $ stackPtr , $ varName , $ currScope ) ) { continue ; } $ this -> markVariableReadAndWarnIfUndefined ( $ phpcsFile , $ varName , $ stackPtr , $ currScope ) ; } }
Called to process variables found in double quoted strings.

Note that there may be more than one variable in the string, which will
result only in one call for the string.

@param PHP_CodeSniffer_File $phpcsFile The PHP_CodeSniffer file where this
token was found.
@param int                  $stackPtr  The position where the double quoted
string was found.

@return void
Called to process variables found in double quoted strings .