function JumpStatementsSpacingSniff::isThrowExpression
2 calls to JumpStatementsSpacingSniff::isThrowExpression()
- JumpStatementsSpacingSniff::checkLinesAfter in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ ControlStructures/ JumpStatementsSpacingSniff.php - JumpStatementsSpacingSniff::checkLinesBefore in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ ControlStructures/ JumpStatementsSpacingSniff.php
File
-
vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ ControlStructures/ JumpStatementsSpacingSniff.php, line 224
Class
Namespace
SlevomatCodingStandard\Sniffs\ControlStructuresCode
private function isThrowExpression(File $phpcsFile, int $jumpStatementPointer) : bool {
$tokens = $phpcsFile->getTokens();
if ($tokens[$jumpStatementPointer]['code'] !== T_THROW) {
return false;
}
$pointerBefore = TokenHelper::findPreviousEffective($phpcsFile, $jumpStatementPointer - 1);
return !in_array($tokens[$pointerBefore]['code'], [
T_SEMICOLON,
T_COLON,
T_OPEN_CURLY_BRACKET,
T_CLOSE_CURLY_BRACKET,
T_OPEN_TAG,
], true);
}