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

Breadcrumb

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

function ScopeHelper::getRootPointer

1 call to ScopeHelper::getRootPointer()
UnusedVariableSniff::process in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Variables/UnusedVariableSniff.php
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ScopeHelper.php, line 38

Class

ScopeHelper
@internal

Namespace

SlevomatCodingStandard\Helpers

Code

public static function getRootPointer(File $phpcsFile, int $pointer) : int {
    $rootPointer = TokenHelper::findNext($phpcsFile, T_OPEN_TAG, 0);
    $rootPointers = array_reverse(self::getAllRootPointers($phpcsFile));
    foreach ($rootPointers as $currentRootPointer) {
        if ($currentRootPointer < $pointer) {
            $rootPointer = $currentRootPointer;
            break;
        }
    }
    return $rootPointer;
}

API Navigation

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