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

Breadcrumb

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

function ConstantSpacingSniff::isNextMemberValid

Overrides AbstractPropertyConstantAndEnumCaseSpacing::isNextMemberValid

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ConstantSpacingSniff.php, line 52

Class

ConstantSpacingSniff

Namespace

SlevomatCodingStandard\Sniffs\Classes

Code

protected function isNextMemberValid(File $phpcsFile, int $pointer) : bool {
    $tokens = $phpcsFile->getTokens();
    if ($tokens[$pointer]['code'] === T_CONST) {
        return true;
    }
    $nextPointer = TokenHelper::findNext($phpcsFile, [
        T_FUNCTION,
        T_ENUM_CASE,
        T_CONST,
        T_VARIABLE,
        T_USE,
    ], $pointer + 1);
    return $tokens[$nextPointer]['code'] === T_CONST;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal