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

Breadcrumb

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

function ClassHelper::getName

11 calls to ClassHelper::getName()
ClassHelper::getAllNames in vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ClassHelper.php
*
ClassHelper::getFullyQualifiedName in vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/ClassHelper.php
ClassStructureSniff::getParentClassName in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ClassStructureSniff.php
ForbiddenPublicPropertySniff::isSniffClass in vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Classes/ForbiddenPublicPropertySniff.php
FunctionHelper::getFullyQualifiedName in vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/FunctionHelper.php

... See full list

File

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

Class

ClassHelper
@internal

Namespace

SlevomatCodingStandard\Helpers

Code

public static function getName(File $phpcsFile, int $classPointer) : string {
    $tokens = $phpcsFile->getTokens();
    if ($tokens[$classPointer]['code'] === T_ANON_CLASS) {
        return 'class@anonymous';
    }
    return $tokens[TokenHelper::findNext($phpcsFile, T_STRING, $classPointer + 1, $tokens[$classPointer]['scope_opener'])]['content'];
}

API Navigation

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