function TokenHelper::findFirstNonWhitespaceOnNextLine
*
Parameters
int $pointer Search starts at this token, inclusive:
2 calls to TokenHelper::findFirstNonWhitespaceOnNextLine()
- InlineDocCommentDeclarationSniff::checkVariable in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ Commenting/ InlineDocCommentDeclarationSniff.php - *
- RequireExplicitAssertionSniff::process in vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Sniffs/ PHP/ RequireExplicitAssertionSniff.php - * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *
File
-
vendor/
slevomat/ coding-standard/ SlevomatCodingStandard/ Helpers/ TokenHelper.php, line 402
Class
- TokenHelper
- @internal
Namespace
SlevomatCodingStandard\HelpersCode
public static function findFirstNonWhitespaceOnNextLine(File $phpcsFile, int $pointer) : ?int {
$newLinePointer = self::findNextContent($phpcsFile, [
T_WHITESPACE,
T_DOC_COMMENT_WHITESPACE,
], $phpcsFile->eolChar, $pointer);
if ($newLinePointer === null) {
return null;
}
$nextPointer = self::findNextExcluding($phpcsFile, [
T_WHITESPACE,
T_DOC_COMMENT_WHITESPACE,
], $newLinePointer + 1);
$tokens = $phpcsFile->getTokens();
if ($nextPointer !== null && $tokens[$pointer]['line'] === $tokens[$nextPointer]['line'] - 1) {
return $nextPointer;
}
return null;
}