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

Breadcrumb

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

function CodeUnit::forClass

@psalm-param class-string $className

Throws

InvalidCodeUnitException

ReflectionException

1 call to CodeUnit::forClass()
Mapper::stringToCodeUnits in vendor/sebastian/code-unit/src/Mapper.php

File

vendor/sebastian/code-unit/src/CodeUnit.php, line 41

Class

CodeUnit
@psalm-immutable

Namespace

SebastianBergmann\CodeUnit

Code

public static function forClass(string $className) : ClassUnit {
    self::ensureUserDefinedClass($className);
    $reflector = self::reflectorForClass($className);
    return new ClassUnit($className, $reflector->getFileName(), range($reflector->getStartLine(), $reflector->getEndLine()));
}

API Navigation

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