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

Breadcrumb

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

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

JumpStatementsSpacingSniff

Namespace

SlevomatCodingStandard\Sniffs\ControlStructures

Code

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);
}

API Navigation

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