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

Breadcrumb

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

function ClassHelper::getAllNames

*

Return value

array<int, string>

1 call to ClassHelper::getAllNames()
ReferenceUsedNamesOnlySniff::process in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/ReferenceUsedNamesOnlySniff.php
* @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint *

File

vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ClassHelper.php, line 66

Class

ClassHelper
@internal

Namespace

SlevomatCodingStandard\Helpers

Code

public static function getAllNames(File $phpcsFile) : array {
    $tokens = $phpcsFile->getTokens();
    $names = [];
    
    /** @var int $classPointer */
    foreach (self::getAllClassPointers($phpcsFile) as $classPointer) {
        if ($tokens[$classPointer]['code'] === T_ANON_CLASS) {
            continue;
        }
        $names[$classPointer] = self::getName($phpcsFile, $classPointer);
    }
    return $names;
}

API Navigation

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