function JumpStatementsSpacingSniff::isLastInLastCaseOrDefault
1 call to JumpStatementsSpacingSniff::isLastInLastCaseOrDefault()
- JumpStatementsSpacingSniff::getLinesCountAfterLast in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ ControlStructures/ JumpStatementsSpacingSniff.php - * @phpcsSuppress SlevomatCodingStandard.Functions.UnusedParameter.UnusedParameter
File
-
vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ ControlStructures/ JumpStatementsSpacingSniff.php, line 271
Class
Namespace
SlevomatCodingStandard\Sniffs\ControlStructuresCode
private function isLastInLastCaseOrDefault(File $phpcsFile, int $jumpStatementEndPointer) : bool {
if (!$this->isLastInCaseOrDefault($phpcsFile, $jumpStatementEndPointer)) {
return false;
}
$nextPointer = TokenHelper::findNextEffective($phpcsFile, $jumpStatementEndPointer + 1);
return !in_array($phpcsFile->getTokens()[$nextPointer]['code'], [
T_CASE,
T_DEFAULT,
], true);
}