Documentation

CodeUnit
in package

Read onlyYes
AbstractYes
Tags
immutable

Table of Contents

Properties

$name  : non-empty-string
$sourceFileName  : non-empty-string
$sourceLines  : array<int, int>

Methods

forClass()  : ClassUnit
forClassMethod()  : ClassMethodUnit
forFileWithAbsolutePath()  : FileUnit
forFunction()  : FunctionUnit
forInterface()  : InterfaceUnit
forInterfaceMethod()  : InterfaceMethodUnit
forTrait()  : TraitUnit
forTraitMethod()  : TraitMethodUnit
isClass()  : bool
isClassMethod()  : bool
isFile()  : bool
isFunction()  : bool
isInterface()  : bool
isInterfaceMethod()  : bool
isTrait()  : bool
isTraitMethod()  : bool
name()  : non-empty-string
sourceFileName()  : non-empty-string
sourceLines()  : array<int, int>
__construct()  : mixed
ensureFileExistsAndIsReadable()  : void
ensureUserDefinedClass()  : void
ensureUserDefinedInterface()  : void
ensureUserDefinedTrait()  : void
reflectorForClassMethod()  : ReflectionMethod
reflectorForFunction()  : ReflectionFunction

Properties

$sourceFileName

private non-empty-string $sourceFileName

$sourceLines

private array<int, int> $sourceLines

Methods

isClass()

public isClass() : bool
Tags
phpstan-assert-if-true

ClassUnit $this

Return values
bool

isClassMethod()

public isClassMethod() : bool
Tags
phpstan-assert-if-true

ClassMethodUnit $this

Return values
bool

isFile()

public isFile() : bool
Tags
phpstan-assert-if-true

FileUnit $this

Return values
bool

isFunction()

public isFunction() : bool
Tags
phpstan-assert-if-true

FunctionUnit $this

Return values
bool

isInterface()

public isInterface() : bool
Tags
phpstan-assert-if-true

InterfaceUnit $this

Return values
bool

isInterfaceMethod()

public isInterfaceMethod() : bool
Tags
phpstan-assert-if-true

InterfaceMethodUnit $this

Return values
bool

isTrait()

public isTrait() : bool
Tags
phpstan-assert-if-true

TraitUnit $this

Return values
bool

isTraitMethod()

public isTraitMethod() : bool
Tags
phpstan-assert-if-true

TraitMethodUnit $this

Return values
bool

name()

public name() : non-empty-string
Return values
non-empty-string

sourceFileName()

public sourceFileName() : non-empty-string
Return values
non-empty-string

sourceLines()

public sourceLines() : array<int, int>
Return values
array<int, int>

__construct()

private __construct(non-empty-string $name, non-empty-string $sourceFileName, array<int, int> $sourceLines) : mixed
Parameters
$name : non-empty-string
$sourceFileName : non-empty-string
$sourceLines : array<int, int>

ensureFileExistsAndIsReadable()

private static ensureFileExistsAndIsReadable(non-empty-string $path) : void
Parameters
$path : non-empty-string
Tags
throws
InvalidCodeUnitException

ensureUserDefinedClass()

private static ensureUserDefinedClass(class-string $className) : void
Parameters
$className : class-string
Tags
throws
InvalidCodeUnitException

ensureUserDefinedInterface()

private static ensureUserDefinedInterface(class-string $interfaceName) : void
Parameters
$interfaceName : class-string
Tags
throws
InvalidCodeUnitException

ensureUserDefinedTrait()

private static ensureUserDefinedTrait(class-string $traitName) : void
Parameters
$traitName : class-string
Tags
throws
InvalidCodeUnitException

reflectorForClassMethod()

private static reflectorForClassMethod(class-string $className, string $methodName) : ReflectionMethod
Parameters
$className : class-string
$methodName : string
Tags
throws
ReflectionException
Return values
ReflectionMethod

reflectorForFunction()

private static reflectorForFunction(callable-string $functionName) : ReflectionFunction
Parameters
$functionName : callable-string
Tags
throws
ReflectionException
Return values
ReflectionFunction
On this page

Search results