Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TokenHelper.php

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\Helpers

Code

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;
}
RSS feed
Powered by Drupal