Processes this sniff, when one of its tokens is encountered.

@param PHP_CodeSniffer_File $phpcsFile The current file being checked.
@param int $stackPtr The position of the current token in the stack passed in $tokens.

@return void
557215
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
    {
        $tokens = $phpcsFile->getTokens();
        $bracketStart = DWS_Helpers_Bracket::bracketStart($phpcsFile, $stackPtr);
        $bracketEnd = DWS_Helpers_Bracket::bracketEnd($phpcsFile, $stackPtr);

        if ($tokens[$bracketStart]['line'] === $tokens[$bracketEnd]['line']) {
            return; // Single-line expressions don't have indentation to worry about.
        }

        $beginningIndent = DWS_Helpers_WhiteSpace::indentOfLine($phpcsFile, $bracketStart);

        if ($tokens[$bracketEnd]['column'] !== $beginningIndent) {
            $data = [$beginningIndent - 1, $tokens[$bracketEnd]['column'] - 1, $tokens[$bracketEnd]['content']];
            $phpcsFile->addError('Expected indentation of %s spaces, %s found for ending bracket "%s"', $bracketEnd, 'EndIndent', $data);
        }

        $nextToken = $phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, $bracketStart + 1, $bracketEnd, true);
        if ($nextToken !== false && $tokens[$nextToken]['line'] === $tokens[$bracketStart]['line']) {
            $data = [$tokens[$bracketStart]['content']];
            $phpcsFile->addError('Expected first item after opening "%s" to be indented on a new line', $nextToken, 'OpeningIndent', $data);
        }

        $firstOnLine = $bracketStart + 1;
        for ($line = $tokens[$bracketStart]['line'] + 1; $line < $tokens[$bracketEnd]['line']; $line++) {
            while ($tokens[$firstOnLine]['line'] < $line || in_array($tokens[$firstOnLine]['code'], PHP_CodeSniffer_Tokens::$emptyTokens)) {
                if (array_key_exists('parenthesis_closer', $tokens[$firstOnLine])) {
                    $firstOnLine = $tokens[$firstOnLine]['parenthesis_closer'] + 1;
                    $line = $tokens[$firstOnLine]['line'];
                    continue 2;
                } elseif (array_key_exists('bracket_closer', $tokens[$firstOnLine])) {
                    $firstOnLine = $tokens[$firstOnLine]['bracket_closer'] + 1;
                    $line = $tokens[$firstOnLine]['line'];
                    continue 2;
                }

                $firstOnLine++;
            }

            if ($tokens[$firstOnLine]['line'] === $line && $tokens[$firstOnLine]['column'] !== $beginningIndent + 4) {
                $data = [$beginningIndent + 3, $tokens[$firstOnLine]['column'] - 1];
                $phpcsFile->addError('Expected indentation of %s spaces, %s found', $firstOnLine, 'MultiLineIndent', $data);
            }
        }
    }
349677
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
    {
        $tokens = $phpcsFile->getTokens();

        $ignore = array(
                T_DOUBLE_COLON,
                T_OBJECT_OPERATOR,
                T_FUNCTION,
                T_CONST,
        );

        $prevToken = $phpcsFile->findPrevious(T_WHITESPACE, ($stackPtr - 1), null, true);
        if (in_array($tokens[$prevToken]['code'], $ignore) === true) {
            // Not a call to a PHP function.
            return;
        }

        $function = strtolower($tokens[$stackPtr]['content']);
        $pattern  = null;

        if ($this->patternMatch === true) {
            $count   = 0;
            $pattern = preg_replace(
                    $this->forbiddenFunctionNames,
                    $this->forbiddenFunctionsNames,
                    $function,
                    1,
                    $count
            );

            if ($count === 0) {
                return;
            }

            // Remove the pattern delimiters and modifier.
            $pattern = substr($pattern, 1, -2);
        } else {
            if (in_array($function, $this->forbiddenFunctionNames) === false) {
                return;
            }
        }

        $this->addError($phpcsFile, $stackPtr, $function, $pattern);

    }
250000
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr) {
		$tokens = $phpcsFile->getTokens();
		$token = $tokens[$stackPtr];
		// Skip for-loop without body.
		if (isset($token['parenthesis_opener']) === false) {
			return;
		}
		$next = ++$token['parenthesis_opener'];
		$end = --$token['parenthesis_closer'];
		$goodCondition = false;
		for (; $next <= $end; ++$next) {
			$code = $tokens[$next]['code'];
			if (isset(PHP_CodeSniffer_Tokens::$emptyTokens[$code])) {
				continue;
			} else if (!in_array($code, array(T_TRUE, T_FALSE, T_LNUMBER, T_CONSTANT_ENCAPSED_STRING, T_STRING))) {
				$goodCondition = true;
				break;
			}
		}
		if (!$goodCondition) {
			$error = 'Avoid IF statements that are always true or false';
			$phpcsFile->addError($error, $stackPtr, 'Found');
		}
	}
351940
protected function checkTryToken(File $phpcsFile, int $stackPtr): void
    {
        $tokens = $phpcsFile->getTokens();

        if ($tokens[$stackPtr]['code'] !== T_TRY) {
            return;
        }

        $this->expectSingleSpaceAfter($phpcsFile, $stackPtr, 'try');
    }
617821
public function process(File $phpcsFile, $stackPtr) {

		$utils = \PHPCS_SecurityAudit\Sniffs\UtilsFactory::getInstance();
		$tokens = $phpcsFile->getTokens();
		if ($tokens[$stackPtr]['content'] == "'#value'" || $tokens[$stackPtr]['content'] == '"#value"') {
			$closer = $phpcsFile->findNext(T_SEMICOLON, $stackPtr);
			$next = $phpcsFile->findNext(array_merge(\PHP_CodeSniffer\Util\Tokens::$bracketTokens, \PHP_CodeSniffer\Util\Tokens::$emptyTokens, \PHP_CodeSniffer\Util\Tokens::$assignmentTokens),
								$stackPtr + 1, $closer + 1, true);
			if ($next == $closer && $tokens[$next]['code'] == T_SEMICOLON)  {
				// Case of $label = $element['#value'];
				$next = $phpcsFile->findPrevious(\PHP_CodeSniffer\Util\Tokens::$assignmentTokens, $next);
				$next = $phpcsFile->findPrevious(T_VARIABLE, $next);
				$phpcsFile->addWarning('Potential XSS found with #value on ' . $tokens[$next]['content'], $next, 'D7XSSWarFormValue');
			} elseif ($next && $utils::is_token_user_input($tokens[$next])) {
				$phpcsFile->addError('XSS found with #value on ' . $tokens[$next]['content'], $next, 'D7XSSErrFormValue');
			} elseif ($next && \PHP_CodeSniffer\Config::getConfigData('ParanoiaMode')) {
				if (in_array($tokens[$next]['content'], $utils::getXSSMitigationFunctions())) {
					$n = $phpcsFile->findNext($utils::getVariableTokens(), $next + 1, $closer);
					if ($n) {
						$phpcsFile->addWarning('Potential XSS found with #value on ' . $tokens[$n]['content'], $n, 'D7XSSWarFormValue');
					}
				} else {
					$phpcsFile->addWarning('Potential XSS found with #value on ' . $tokens[$next]['content'], $next, 'D7XSSWarFormValue');
				}
			}
		}
	}
1107269
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
    {
        $tokens = $phpcsFile->getTokens();
        $token = $tokens[$stackPtr];

        if (!array_key_exists('scope_opener', $token) || !array_key_exists('scope_closer', $token)) {
            return;
        }

        $scopeOpener = $token['scope_opener'];
        $firstContent = $phpcsFile->findNext(T_WHITESPACE, $scopeOpener + 1, null, true);

        if ($tokens[$firstContent]['line'] !== $tokens[$scopeOpener]['line'] + 1) {
            $phpcsFile->addError('Blank line found at start of control structure', $scopeOpener, 'SpacingBeforeOpen');
        }

        $scopeCloser = $token['scope_closer'];
        $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, $scopeCloser - 1, null, true);

        if ($tokens[$lastContent]['line'] !== $tokens[$scopeCloser]['line'] - 1) {
            $phpcsFile->addError('Blank line found at end of control structure', $lastContent + 2, 'SpacingAfterClose');
        }
    }
1143838
public function process(File $phpcsFile, $stackPtr) {
		$utils = \PHPCS_SecurityAudit\Sniffs\UtilsFactory::getInstance();
		$tokens = $phpcsFile->getTokens();
		$s = $phpcsFile->findNext(\PHP_CodeSniffer\Util\Tokens::$emptyTokens, $stackPtr, null, true, null, true);

		if ($tokens[$s]['code'] == T_OPEN_PARENTHESIS) {
			$closer = $tokens[$s]['parenthesis_closer'];
		} else {
			$closer = $phpcsFile->findNext(T_SEMICOLON, $stackPtr);
			$s = $stackPtr;
		}
		while ($s) {
			$s = $phpcsFile->findNext(array_merge(\PHP_CodeSniffer\Util\Tokens::$emptyTokens, \PHP_CodeSniffer\Util\Tokens::$bracketTokens, \PHPCS_SecurityAudit\Sniffs\Utils::$staticTokens), $s + 1, $closer, true);
			if ($s && $utils::is_token_user_input($tokens[$s])) {
				if (\PHP_CodeSniffer\Config::getConfigData('ParanoiaMode') || !$utils::is_token_false_positive($tokens[$s], $tokens[$s+2])) {
					$phpcsFile->addError('Easy RFI detected because of direct user input with ' . $tokens[$s]['content'] . ' on ' . $tokens[$stackPtr]['content'], $s, 'ErrEasyRFI');
				}
			} elseif ($s && \PHP_CodeSniffer\Config::getConfigData('ParanoiaMode') && $tokens[$s]['content'] != '.') {
				$phpcsFile->addWarning('Possible RFI detected with ' . $tokens[$s]['content'] . ' on ' . $tokens[$stackPtr]['content'], $s, 'WarnEasyRFI');
			}
		}
	}
220588
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
    {
        $tokens    = $phpcsFile->getTokens();
        $errorData = [strtolower($tokens[$stackPtr]['content'])];

        if (false === isset($tokens[$stackPtr]['scope_opener']))
        {
            // @todo sort while thing...
            if ($tokens[$stackPtr]['code'] !== T_WHILE)
            {
                $error = 'Possible parse error: %s missing opening or closing brace';
                $phpcsFile->addWarning($error, $stackPtr, 'MissingBrace', $errorData);
            }

            return;
        }

        $curlyBrace  = $tokens[$stackPtr]['scope_opener'];
        $lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($curlyBrace - 1), $stackPtr, true);
        $classLine   = $tokens[$lastContent]['line'];
        $braceLine   = $tokens[$curlyBrace]['line'];

        if ($braceLine === $classLine)
        {
            $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'same line');
            $error = 'Opening brace of a %s must be on the line after the definition';
            $fix   = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceNewLine', $errorData);

            if (true === $fix)
            {
                $phpcsFile->fixer->beginChangeset();

                if (T_WHITESPACE === $tokens[($curlyBrace - 1)]['code'])
                {
                    $phpcsFile->fixer->replaceToken(($curlyBrace - 1), '');
                }

                $phpcsFile->fixer->addNewlineBefore($curlyBrace);
                $phpcsFile->fixer->endChangeset();
            }

            return;
        }
        else
        {
            $phpcsFile->recordMetric($stackPtr, 'Class opening brace placement', 'new line');

            if ($braceLine > ($classLine + 1))
            {
                $error = 'Opening brace of a %s must be on the line following the %s declaration.; Found %s line(s).';
                $data  = [
                          $tokens[$stackPtr]['content'],
                          $tokens[$stackPtr]['content'],
                          ($braceLine - $classLine - 1),
                         ];
                $fix   = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceWrongLine', $data);

                if (true === $fix)
                {
                    $phpcsFile->fixer->beginChangeset();

                    for ($i = ($curlyBrace - 1); $i > $lastContent; $i--)
                    {
                        if ($tokens[$i]['line'] === ($tokens[$curlyBrace]['line'] + 1))
                        {
                            break;
                        }

                        $phpcsFile->fixer->replaceToken($i, '');
                    }

                    $phpcsFile->fixer->endChangeset();
                }

                return;
            }
        }

        if ($tokens[($curlyBrace + 1)]['content'] !== $phpcsFile->eolChar)
        {
            $error = 'Opening %s brace must be on a line by itself.';
            $fix   = $phpcsFile->addFixableError($error, $curlyBrace, 'OpenBraceNotAlone', $errorData);

            if (true === $fix)
            {
                $phpcsFile->fixer->addContent($curlyBrace, $phpcsFile->eolChar);
            }
        }

        if (T_WHITESPACE === $tokens[($curlyBrace - 1)]['code'])
        {
            $prevContent = $tokens[($curlyBrace - 1)]['content'];

            if ($prevContent === $phpcsFile->eolChar)
            {
                $spaces = 0;
            }
            else
            {
                $blankSpace = substr($prevContent, strpos($prevContent, $phpcsFile->eolChar));
                $spaces     = strlen($blankSpace);
            }

            $expected = ($tokens[$stackPtr]['level'] * $this->indent);

            if ($spaces !== $expected)
            {
                $error = 'Expected %s spaces before opening brace; %s found';
                $data  = [
                          $expected,
                          $spaces,
                         ];
                $fix   = $phpcsFile->addFixableError($error, $curlyBrace, 'SpaceBeforeBrace', $data);

                if ($fix === true)
                {
                    $indent = str_repeat(' ', $expected);

                    if ($spaces === 0)
                    {
                        $phpcsFile->fixer->addContentBefore($curlyBrace, $indent);
                    }
                    else
                    {
                        $phpcsFile->fixer->replaceToken(($curlyBrace - 1), $indent);
                    }
                }
            }
        }
    }
507635
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
    {
        $tokens = $phpcsFile->getTokens();
        $arrayStart = DWS_Helpers_Bracket::bracketStart($phpcsFile, $stackPtr);
        $arrayEnd = DWS_Helpers_Bracket::bracketEnd($phpcsFile, $stackPtr);

        $isSingleLine = $tokens[$arrayStart]['line'] === $tokens[$arrayEnd]['line'];

        foreach (DWS_Helpers_Array::commaPositions($phpcsFile, $arrayStart) as $comma) {
            if ($tokens[$comma - 1]['code'] === T_WHITESPACE) {
                $phpcsFile->addError('No whitespace allowed before commas in an array', $comma, 'SpaceBeforeComma');
            }

            if ($isSingleLine) {
                if ($tokens[$comma + 1]['content'] !== ' ') {
                    $phpcsFile->addError('Expected 1 space after comma in single-line array', $comma, 'SingleLineSpaceAfterComma');
                }
            } elseif ($tokens[$comma + 1]['content'][0] !== "\n") {
                $nextMember = $phpcsFile->findNext([T_WHITESPACE, T_COMMENT], $comma + 1, $arrayEnd, true);
                if ($nextMember !== false && $tokens[$nextMember]['line'] === $tokens[$comma]['line']) {
                    $phpcsFile->addError('Comma in multi-line array was not last token on line', $comma, 'MultiLineNewlineAfterComma');
                }
            }
        }
    }
763379
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
    {
        $this->currentFile = $phpcsFile;

        $tokens = $phpcsFile->getTokens();
        $type = strtolower($tokens[$stackPtr]['content']);
        $errorData = array($type);

        $find = PHP_CodeSniffer_Tokens::$methodPrefixes;
        $find[] = T_WHITESPACE;

        $commentEnd = $phpcsFile->findPrevious($find, ($stackPtr - 1), null, true);
        if ($tokens[$commentEnd]['code'] !== T_DOC_COMMENT_CLOSE_TAG
            && $tokens[$commentEnd]['code'] !== T_COMMENT
        ) {
            $fix = $phpcsFile->addFixableError('Missing class doc comment', $stackPtr, 'Missing');

            if (true === $fix) {
                $className = $tokens[$stackPtr + 2]['content'];

                $packageName = $this->findNamespace($tokens);

                $comment =
                    sprintf(
                        "/**" . $phpcsFile->eolChar .
                        " * Class %s" . $phpcsFile->eolChar .
                        ($packageName ? sprintf(" * @package %s" . $phpcsFile->eolChar, $packageName) : '') .
                        " */" . $phpcsFile->eolChar,
                        $className
                    );

                $phpcsFile->fixer->addContentBefore($stackPtr, $comment);
            }

            $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'no');

            return;
        } else {
            $phpcsFile->recordMetric($stackPtr, 'Class has doc comment', 'yes');
        }

        // Try and determine if this is a file comment instead of a class comment.
        // We assume that if this is the first comment after the open PHP tag, then
        // it is most likely a file comment instead of a class comment.
        if ($tokens[$commentEnd]['code'] === T_DOC_COMMENT_CLOSE_TAG) {
            $start = ($tokens[$commentEnd]['comment_opener'] - 1);
        } else {
            $start = $phpcsFile->findPrevious(T_COMMENT, ($commentEnd - 1), null, true);
        }

        $prev = $phpcsFile->findPrevious(T_WHITESPACE, $start, null, true);
        if ($tokens[$prev]['code'] === T_OPEN_TAG) {
            $prevOpen = $phpcsFile->findPrevious(T_OPEN_TAG, ($prev - 1));
            if ($prevOpen === false) {
                // This is a comment directly after the first open tag,
                // so probably a file comment.
                $phpcsFile->addError('Missing class doc comment', $stackPtr, 'Missing');

                return;
            }
        }

        if ($tokens[$commentEnd]['code'] === T_COMMENT) {
            $phpcsFile->addError('You must use "/**" style comments for a class comment', $stackPtr, 'WrongStyle');

            return;
        }

        // Check each tag.
        $this->processTags($phpcsFile, $stackPtr, $tokens[$commentEnd]['comment_opener']);

    }
345623
public function process(File $phpcsFile, $stackPtr)
    {
        $this->checkSpacing($phpcsFile, $stackPtr, true);
        $this->checkSpacing($phpcsFile, $stackPtr, false);
    }
41979
public function process(File $phpcsFile, $stackPtr) {
		$tokens = $phpcsFile->getTokens();
		$s = $phpcsFile->findNext(\PHP_CodeSniffer\Util\Tokens::$stringTokens, $stackPtr + 1);
		if (preg_match('/\.(\w+)(?:\'|\")$/', $tokens[$s]['content'], $matches)) {
			$ext = $matches[1];
			if (!array_key_exists($ext, $phpcsFile->config->extensions)) {
				$phpcsFile->addError("The file extension '.$ext' that is not specified by --extensions has been used in a include/require function. Please add it to the scan process.", $stackPtr, 'ErrMiscIncludeMismatch');
			}
		} else {
			$phpcsFile->addError("No file extension has been found in a include/require function. This implies that some PHP code is not scanned by PHPCS.", $stackPtr, 'ErrMiscIncludeMismatchNoExt');
		}
	}
401868
public function process(File $phpcsFile, $stackPtr)
    {
        $tokens = $phpcsFile->getTokens();
        $open   = $tokens[$stackPtr];

        if ($open['code'] === T_ARRAY) {
            $closePtr = $open['parenthesis_closer'];
        } else {
            $closePtr = $open['bracket_closer'];
        }

        if ($open['line'] <> $tokens[$closePtr]['line']) {
            $arrayIsNotEmpty = $phpcsFile->findPrevious(
                array(
                    T_WHITESPACE,
                    T_COMMENT,
                    T_ARRAY,
                    T_OPEN_PARENTHESIS,
                    T_OPEN_SHORT_ARRAY,
                ),
                $closePtr - 1,
                $stackPtr,
                true
            );
            if ($arrayIsNotEmpty !== false) {
                $lastCommaPtr = $phpcsFile->findPrevious(
                    T_COMMA,
                    $closePtr,
                    $stackPtr
                );
                while ($lastCommaPtr < $closePtr -1) {
                    $lastCommaPtr++;

                    if ($tokens[$lastCommaPtr]['code'] !== T_WHITESPACE
                        && $tokens[$lastCommaPtr]['code'] !== T_COMMENT
                    ) {
                        $fix = $phpcsFile->addFixableError(
                            'Add a comma after each item in a multi-line array',
                            $stackPtr,
                            'Invalid'
                        );

                        if ($fix === true) {
                            $ptr = $phpcsFile->findPrevious(
                                array(T_WHITESPACE, T_COMMENT),
                                $closePtr-1,
                                $stackPtr,
                                true
                            );

                            $phpcsFile->fixer->addContent($ptr, ',');
                            $phpcsFile->fixer->endChangeset();
                        }

                        break;
                    }
                }
            }
        }
    }
1263266
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
	{
		$tokens = $phpcsFile->getTokens();
		$className = $phpcsFile->findNext(T_STRING, $stackPtr);
		$name      = trim($tokens[$className]['content']);
		$errorData = array(ucfirst($tokens[$stackPtr]['content']));
		$classProperties = $phpcsFile->getClassProperties($stackPtr);

		$startsWithAbstract = substr($name, 0, 8) == 'Abstract';

		if ($classProperties['is_abstract'] && !$startsWithAbstract) {
			$error = '%s name must begin with "Abstract"';
			$phpcsFile->addError($error, $stackPtr, 'StartWithAbstract', $errorData);
		}

		if (!$classProperties['is_abstract'] && $startsWithAbstract) {
			$error = '%s name must not begin with "Abstract"';
			$phpcsFile->addError($error, $stackPtr, 'StartNotWithAbstract', $errorData);
		}
	}
197417
public function process(File $phpcsFile, $stackPtr) {
		$utils = \PHPCS_SecurityAudit\Sniffs\UtilsFactory::getInstance();
		$tokens = $phpcsFile->getTokens();

		// http://www.php.net/manual/en/book.mysqli.php
		$mysqlifunctions = array('query', 'prepare', 'multi_query', 'real_query');

		if ($tokens[$stackPtr]['code'] == T_NEW) {
			$s = $phpcsFile->findNext(T_STRING, $stackPtr);
			if ($tokens[$s]['content'] == 'mysqli') {
				$s = $phpcsFile->findPrevious(T_VARIABLE, $stackPtr);
				if ($s)
					$utils::addSQLObjects($tokens[$s]['content']);
			}
		} elseif ($tokens[$stackPtr]['code'] == T_OBJECT_OPERATOR) {
			$prev = $phpcsFile->findPrevious(T_VARIABLE, $stackPtr);
			if ($prev && in_array($tokens[$prev]['content'], $utils::getSQLObjects())) {
				$next = $phpcsFile->findNext(T_STRING, $stackPtr);
				if ($next && in_array($tokens[$next]['content'], $mysqlifunctions)) {
					$s = $utils::findDirtyParam($phpcsFile, $next);
					if ($s) {
						$msg = 'MYSQLi function ' . $tokens[$next]['content'] . '() detected with dynamic parameter ';
						if ($utils::is_token_user_input($tokens[$s])) {
							$phpcsFile->addError($msg . ' directly from user input', $stackPtr, 'ErrMysqli');
						} else {
							$phpcsFile->addWarning($msg, $stackPtr, 'WarnMysqli');
						}
					}
				}
			}
		} elseif ($tokens[$stackPtr]['code'] == T_STRING && $tokens[$stackPtr]['content'] == 'mysqli_connect') {
			$prev = $phpcsFile->findPrevious(T_VARIABLE, $stackPtr);
			if ($prev)
				$utils::addSQLObjects($tokens[$prev]['content']);
			$s = $utils::findDirtyParam($phpcsFile, $stackPtr);
			if ($utils::is_token_user_input($tokens[$s])) {
				$phpcsFile->addError('mysqli_connect() param directly from user input', $stackPtr, 'ErrMysqliconnect');
			}
		} elseif ($tokens[$stackPtr]['code'] == T_STRING && in_array($tokens[$stackPtr]['content'],array_map(function($v) { return 'mysqli_' . $v; }, $mysqlifunctions))) {
			// The first parameter is always the link
			$p2 = $utils::get_param_tokens($phpcsFile, $stackPtr, 2);
			$s = $phpcsFile->findNext(array_merge(\PHP_CodeSniffer\Util\Tokens::$emptyTokens, \PHP_CodeSniffer\Util\Tokens::$bracketTokens, \PHPCS_SecurityAudit\Sniffs\Utils::$staticTokens, array(T_STRING_CONCAT)), $p2[0]['stackPtr'], end($p2)['stackPtr']+1, true);
			if ($s) {
				$msg = 'MYSQLi function ' . $tokens[$stackPtr]['content'] . '() detected with dynamic parameter ';
				if ($utils::is_token_user_input($tokens[$s])) {
					$phpcsFile->addError($msg . ' directly from user input', $stackPtr, 'ErrMysqli' . $tokens[$stackPtr]['content']);
				} else {
					$phpcsFile->addWarning($msg, $stackPtr, 'WarnMysqli' . $tokens[$stackPtr]['content']);
				}
			}
		}

	}
810803
public function process(File $phpcsFile, $stackPtr) {
		$utils = \PHPCS_SecurityAudit\Sniffs\UtilsFactory::getInstance();
		if ($this->forceParanoia >= 0) {
			$parano =  $this->forceParanoia ? 1 : 0;
		} else {
			$parano = \PHP_CodeSniffer\Config::getConfigData('ParanoiaMode') ? 1 : 0;
		}
		$tokens = $phpcsFile->getTokens();
		$s = $phpcsFile->findNext(\PHP_CodeSniffer\Util\Tokens::$emptyTokens, $stackPtr, null, true, null, true);

		if ($tokens[$stackPtr]['code'] == T_OPEN_TAG_WITH_ECHO) {
			$closer = $phpcsFile->findNext(T_CLOSE_TAG, $stackPtr);
		} elseif ($tokens[$s]['code'] == T_OPEN_PARENTHESIS) {
			$closer = $tokens[$s]['parenthesis_closer'];
		} else {
			$closer = $phpcsFile->findNext(array(T_SEMICOLON, T_CLOSE_TAG), $stackPtr);
			$s = $stackPtr;
		}

		$warn = false;
		while ($s) {
			$s = $phpcsFile->findNext(array_merge(\PHP_CodeSniffer\Util\Tokens::$emptyTokens, \PHP_CodeSniffer\Util\Tokens::$bracketTokens, \PHPCS_SecurityAudit\Sniffs\Utils::$staticTokens), $s + 1, $closer, true);
			if ($s && $utils::is_token_user_input($tokens[$s])) {
				$phpcsFile->addError('Easy XSS detected because of direct user input with ' . $tokens[$s]['content'] . ' on ' . $tokens[$stackPtr]['content'], $s, 'EasyXSSerr');
			} elseif ($s && $utils::is_XSS_mitigation($tokens[$s]['content'])) {
				if (array_key_exists('parenthesis_closer', $tokens[$s+1])) {
					$s = $tokens[$s+1]['parenthesis_closer'];
				}
			} elseif ($s && $parano && !$warn) {
				$warn = $s;
			}
		}
		if ($warn)
			$phpcsFile->addWarning('Possible XSS detected with ' . $tokens[$warn]['content'] . ' on ' . $tokens[$stackPtr]['content'], $warn, 'EasyXSSwarn');
	}
1077896
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
	{
		$tokens    = $phpcsFile->getTokens();
		$nextToken = $phpcsFile->findNext(PHP_CodeSniffer_Tokens::$emptyTokens, ($stackPtr + 1), null, true);

		if ($tokens[$nextToken]['code'] === T_OPEN_PARENTHESIS && $tokens[($stackPtr)]['code'] !== T_ECHO)
		{
			$error = '"%s" is a statement not a function; no parentheses are required';
			$data  = array($tokens[$stackPtr]['content']);
			$fix   = $phpcsFile->addFixableError($error, $stackPtr, 'BracketsNotRequired', $data);

			if ($fix === true)
			{
				$end      = $phpcsFile->findEndOfStatement($nextToken);
				$ignore   = PHP_CodeSniffer_Tokens::$emptyTokens;
				$ignore[] = T_SEMICOLON;
				$closer   = $phpcsFile->findPrevious($ignore, ($end - 1), null, true);

				$phpcsFile->fixer->beginChangeset();
				$phpcsFile->fixer->replaceToken($nextToken, '');

				if ($tokens[($stackPtr + 1)]['code'] === T_WHITESPACE)
				{
					$phpcsFile->fixer->replaceToken(($stackPtr + 1), '');
				}

				if ($tokens[$closer]['code'] === T_CLOSE_PARENTHESIS)
				{
					$phpcsFile->fixer->replaceToken($closer, '');
				}

				$phpcsFile->fixer->addContent($stackPtr, ' ');
				$phpcsFile->fixer->endChangeset();
			}
		}

		if ($tokens[($stackPtr)]['code'] === T_ECHO
			&& $tokens[$nextToken]['code'] === T_OPEN_PARENTHESIS
			&& $tokens[($stackPtr + 1)]['code'] !== T_WHITESPACE
		)
		{
			$error = 'There must be one space between the "%s" statement and the opening parenthesis';
			$data  = array($tokens[$stackPtr]['content']);
			$fix   = $phpcsFile->addFixableError($error, $stackPtr, 'SpacingAfterEcho', $data);

			if ($fix === true)
			{
				$this->requiredSpacesBeforeOpen = 1;
				$padding = str_repeat(' ', $this->requiredSpacesBeforeOpen);
				$phpcsFile->fixer->addContent($stackPtr, $padding);
			}
		}
	}