CodeUnit
in package
Read onlyYes
AbstractYes
Tags
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
$name
private
non-empty-string
$name
$sourceFileName
private
non-empty-string
$sourceFileName
$sourceLines
private
array<int, int>
$sourceLines
Methods
forClass()
public
static forClass(class-string $className) : ClassUnit
Parameters
- $className : class-string
Tags
Return values
ClassUnitforClassMethod()
public
static forClassMethod(class-string $className, string $methodName) : ClassMethodUnit
Parameters
- $className : class-string
- $methodName : string
Tags
Return values
ClassMethodUnitforFileWithAbsolutePath()
public
static forFileWithAbsolutePath(non-empty-string $path) : FileUnit
Parameters
- $path : non-empty-string
Tags
Return values
FileUnitforFunction()
public
static forFunction(callable-string $functionName) : FunctionUnit
Parameters
- $functionName : callable-string
Tags
Return values
FunctionUnitforInterface()
public
static forInterface(class-string $interfaceName) : InterfaceUnit
Parameters
- $interfaceName : class-string
Tags
Return values
InterfaceUnitforInterfaceMethod()
public
static forInterfaceMethod(class-string $interfaceName, string $methodName) : InterfaceMethodUnit
Parameters
- $interfaceName : class-string
- $methodName : string
Tags
Return values
InterfaceMethodUnitforTrait()
public
static forTrait(class-string $traitName) : TraitUnit
Parameters
- $traitName : class-string
Tags
Return values
TraitUnitforTraitMethod()
public
static forTraitMethod(class-string $traitName, string $methodName) : TraitMethodUnit
Parameters
- $traitName : class-string
- $methodName : string
Tags
Return values
TraitMethodUnitisClass()
public
isClass() : bool
Tags
Return values
boolisClassMethod()
public
isClassMethod() : bool
Tags
Return values
boolisFile()
public
isFile() : bool
Tags
Return values
boolisFunction()
public
isFunction() : bool
Tags
Return values
boolisInterface()
public
isInterface() : bool
Tags
Return values
boolisInterfaceMethod()
public
isInterfaceMethod() : bool
Tags
Return values
boolisTrait()
public
isTrait() : bool
Tags
Return values
boolisTraitMethod()
public
isTraitMethod() : bool
Tags
Return values
boolname()
public
name() : non-empty-string
Return values
non-empty-stringsourceFileName()
public
sourceFileName() : non-empty-string
Return values
non-empty-stringsourceLines()
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
ensureUserDefinedClass()
private
static ensureUserDefinedClass(class-string $className) : void
Parameters
- $className : class-string
Tags
ensureUserDefinedInterface()
private
static ensureUserDefinedInterface(class-string $interfaceName) : void
Parameters
- $interfaceName : class-string
Tags
ensureUserDefinedTrait()
private
static ensureUserDefinedTrait(class-string $traitName) : void
Parameters
- $traitName : class-string
Tags
reflectorForClassMethod()
private
static reflectorForClassMethod(class-string $className, string $methodName) : ReflectionMethod
Parameters
- $className : class-string
- $methodName : string
Tags
Return values
ReflectionMethodreflectorForFunction()
private
static reflectorForFunction(callable-string $functionName) : ReflectionFunction
Parameters
- $functionName : callable-string