WPThemeReview/Sniffs/CoreFunctionality/FileIncludeSniff.php
public function process( File $phpcsFile, $stackPtr ) {

		$tokens    = $phpcsFile->getTokens();
		$token     = $tokens[ $stackPtr ];
		$file_name = basename( $phpcsFile->getFileName() );

		if ( ! isset( $this->file_whitelist[ $file_name ] ) ) {
			$phpcsFile->addWarning(
				'Check that %s is not being used to load template files. "get_template_part()" should be used to load template files.',
				$stackPtr,
				'FileIncludeFound',
				array( $token['content'] )
			);
		}
	}
public function process( File $phpcsFile, $stackPtr ) {

		$tokens    = $phpcsFile->getTokens();
		$token     = $tokens[ $stackPtr ];
		$file_name = basename( $phpcsFile->getFileName() );

		if ( ! isset( $this->file_whitelist[ $file_name ] ) ) {
			$phpcsFile->addWarning(
				'Check that %s is not being used to load template files. "get_template_part()" should be used to load template files.',
				$stackPtr,
				'FileIncludeFound',
				array( $token['content'] )
			);
		}
	}
Processes this test, when one of its tokens is encountered.

@param \PHP_CodeSniffer\Files\File $phpcsFile The PHP_CodeSniffer file where the
token was found.
@param int                         $stackPtr  The position of the current token
in the stack.

@return void