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

Breadcrumb

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

function EarlyExitSniff::process

* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *

Parameters

int $pointer:

Overrides Sniff::process

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/EarlyExitSniff.php, line 66

Class

EarlyExitSniff

Namespace

SlevomatCodingStandard\Sniffs\ControlStructures

Code

public function process(File $phpcsFile, $pointer) : void {
    $tokens = $phpcsFile->getTokens();
    if ($tokens[$pointer]['code'] === T_IF) {
        $this->processIf($phpcsFile, $pointer);
    }
    elseif ($tokens[$pointer]['code'] === T_ELSEIF) {
        $this->processElseIf($phpcsFile, $pointer);
    }
    else {
        $this->processElse($phpcsFile, $pointer);
    }
}
RSS feed
Powered by Drupal