function EmptyClassDefinitionSniff::process
Processes the tokens that this sniff is interested in.
Parameters
\PHP_CodeSniffer\Files\File $phpcsFile The file where the token was found.:
int $stackPtr The position in the stack where: the token was found.
Return value
void
Overrides Sniff::process
File
-
vendor/
squizlabs/ php_codesniffer/ src/ Standards/ Squiz/ Sniffs/ CSS/ EmptyClassDefinitionSniff.php, line 50
Class
Namespace
PHP_CodeSniffer\Standards\Squiz\Sniffs\CSSCode
public function process(File $phpcsFile, $stackPtr) {
$tokens = $phpcsFile->getTokens();
$next = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true);
if ($next === false || $tokens[$next]['code'] === T_CLOSE_CURLY_BRACKET) {
$error = 'Class definition is empty';
$phpcsFile->addError($error, $stackPtr, 'Found');
}
}