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

Breadcrumb

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

function BlockControlStructureSpacingSniff::isWhilePartOfDo

1 call to BlockControlStructureSpacingSniff::isWhilePartOfDo()
BlockControlStructureSpacingSniff::process in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/BlockControlStructureSpacingSniff.php
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/ControlStructures/BlockControlStructureSpacingSniff.php, line 101

Class

BlockControlStructureSpacingSniff

Namespace

SlevomatCodingStandard\Sniffs\ControlStructures

Code

private function isWhilePartOfDo(File $phpcsFile, int $controlStructurePointer) : bool {
    $tokens = $phpcsFile->getTokens();
    $pointerBefore = TokenHelper::findPreviousEffective($phpcsFile, $controlStructurePointer - 1);
    return $tokens[$controlStructurePointer]['code'] === T_WHILE && $tokens[$pointerBefore]['code'] === T_CLOSE_CURLY_BRACKET && array_key_exists('scope_condition', $tokens[$pointerBefore]) && $tokens[$tokens[$pointerBefore]['scope_condition']]['code'] === T_DO;
}

API Navigation

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