-
-
Notifications
You must be signed in to change notification settings - Fork 519
Closed
Description
Is there a way to ignore parts of Sniffs? For example, I would like to ignore this rule: 'Blank line found at start of control structure' found here:
$firstContent = $phpcsFile->findNext(T_WHITESPACE, ($scopeOpener + 1), null, true);
if ($tokens[$firstContent]['line'] !== ($tokens[$scopeOpener]['line'] + 1) && $tokens[$firstContent]['code'] != T_CLOSE_TAG) {
$error = 'Blank line found at start of control structure';
$phpcsFile->addError($error, $scopeOpener);
}
$lastContent = $phpcsFile->findPrevious(T_WHITESPACE, ($scopeCloser - 1), null, true);
if ($tokens[$lastContent]['line'] !== ($tokens[$scopeCloser]['line'] - 1)) {
$errorToken = $scopeCloser;
for ($i = ($scopeCloser - 1); $i > $lastContent; $i--) {
if ($tokens[$i]['line'] < $tokens[$scopeCloser]['line'] && $tokens[$firstContent]['code'] != T_OPEN_TAG) {
$error = 'Blank line found at end of control structure';
$phpcsFile->addError($error, $i);
break;
}
}
}
Metadata
Metadata
Assignees
Labels
No labels