Documentation

ClassUnit extends CodeUnit
in package

FinalYes
Tags
psalm-immutable

Table of Contents

Properties

$name  : string
$sourceFileName  : string
$sourceLines  : array<string|int, mixed>

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()  : string
sourceFileName()  : string
sourceLines()  : array<string|int, mixed>
__construct()  : mixed
ensureFileExistsAndIsReadable()  : void
ensureUserDefinedClass()  : void
ensureUserDefinedInterface()  : void
ensureUserDefinedTrait()  : void
reflectorForClass()  : ReflectionClass
reflectorForClassMethod()  : ReflectionMethod
reflectorForFunction()  : ReflectionFunction

Properties

$sourceFileName read-only

private string $sourceFileName

$sourceLines read-only

private array<string|int, mixed> $sourceLines
Tags
psalm-var

list

Methods

isClass()

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

ClassUnit $this

Return values
bool

isClassMethod()

public isClassMethod() : bool
Return values
bool

isFile()

public isFile() : bool
Return values
bool

isFunction()

public isFunction() : bool
Return values
bool

isInterface()

public isInterface() : bool
Return values
bool

isInterfaceMethod()

public isInterfaceMethod() : bool
Return values
bool

isTrait()

public isTrait() : bool
Return values
bool

isTraitMethod()

public isTraitMethod() : bool
Return values
bool

name()

public name() : string
Return values
string

sourceFileName()

public sourceFileName() : string
Return values
string

sourceLines()

public sourceLines() : array<string|int, mixed>
Tags
psalm-return

list

Return values
array<string|int, mixed>

__construct()

private __construct(string $name, string $sourceFileName, array<string|int, mixed> $sourceLines) : mixed
Parameters
$name : string
$sourceFileName : string
$sourceLines : array<string|int, mixed>
Tags
psalm-param

list $sourceLines

ensureFileExistsAndIsReadable()

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

ensureUserDefinedClass()

private static ensureUserDefinedClass(string $className) : void
Parameters
$className : string
Tags
psalm-param

class-string $className

throws
InvalidCodeUnitException

ensureUserDefinedInterface()

private static ensureUserDefinedInterface(string $interfaceName) : void
Parameters
$interfaceName : string
Tags
psalm-param

class-string $interfaceName

throws
InvalidCodeUnitException

ensureUserDefinedTrait()

private static ensureUserDefinedTrait(string $traitName) : void
Parameters
$traitName : string
Tags
psalm-param

class-string $traitName

throws
InvalidCodeUnitException

reflectorForClass()

private static reflectorForClass(string $className) : ReflectionClass
Parameters
$className : string
Tags
psalm-param

class-string $className

throws
ReflectionException
Return values
ReflectionClass

reflectorForClassMethod()

private static reflectorForClassMethod(string $className, string $methodName) : ReflectionMethod
Parameters
$className : string
$methodName : string
Tags
psalm-param

class-string $className

throws
ReflectionException
Return values
ReflectionMethod

reflectorForFunction()

private static reflectorForFunction(string $functionName) : ReflectionFunction
Parameters
$functionName : string
Tags
psalm-param

callable-string $functionName

throws
ReflectionException
Return values
ReflectionFunction

        
On this page

Search results