class ClassType

Class/Interface/Trait description.

Traits

Strict class for better experience.

Constants

TYPE_CLASS

TYPE_INTERFACE

TYPE_TRAIT

VISIBILITY_PUBLIC

VISIBILITY_PROTECTED

VISIBILITY_PRIVATE

Properties

Method[] $methods
Property[] $properties

Methods

static ClassType
from(string|object $class)

No description

static ClassType
withBodiesFrom(string|object $class)

No description

__construct(string $name = null, PhpNamespace $namespace = null)

No description

string
__toString()

No description

PhpNamespace|null
getNamespace() deprecated

No description

setName(string|null $name)

No description

string|null
getName()

No description

setClass()

No description

bool
isClass()

No description

setInterface()

No description

bool
isInterface()

No description

setTrait()

No description

bool
isTrait()

No description

setType(string $type)

No description

string
getType()

No description

setFinal(bool $state = true)

No description

bool
isFinal()

No description

setAbstract(bool $state = true)

No description

bool
isAbstract()

No description

setExtends(string|string[] $names)

No description

string|string[]
getExtends()

No description

addExtend(string $name)

No description

setImplements(array $names)

No description

array
getImplements()

No description

addImplement(string $name)

No description

removeImplement(string $name)

No description

setTraits(array $names)

No description

array
getTraits()

No description

array
getTraitResolutions()

No description

addTrait(string $name, array $resolutions = [])

No description

removeTrait(string $name)

No description

addMember(Method|Property|Constant $member)

No description

setConstants(array $consts)

No description

array
getConstants()

No description

addConstant(string $name, $value)

No description

removeConstant(string $name)

No description

setProperties(array $props)

No description

array
getProperties()

No description

getProperty(string $name)

No description

addProperty(string $name, $value = null)

No description

removeProperty(string $name)

No description

bool
hasProperty(string $name)

No description

setMethods(array $methods)

No description

array
getMethods()

No description

getMethod(string $name)

No description

addMethod(string $name)

No description

removeMethod(string $name)

No description

bool
hasMethod(string $name)

No description

void
validate()

No description

__clone()

No description

Details

at line 73
static ClassType from(string|object $class)

Parameters

string|object $class

Return Value

ClassType

at line 82
static ClassType withBodiesFrom(string|object $class)

Parameters

string|object $class

Return Value

ClassType

at line 88
__construct(string $name = null, PhpNamespace $namespace = null)

Parameters

string $name
PhpNamespace $namespace

at line 95
string __toString()

Return Value

string

at line 110
PhpNamespace|null getNamespace() deprecated

deprecated an object can be in multiple namespaces

Return Value

PhpNamespace|null

at line 117
ClassType setName(string|null $name)

Parameters

string|null $name

Return Value

ClassType

at line 127
string|null getName()

Return Value

string|null

at line 134
ClassType setClass()

Return Value

ClassType

at line 141
bool isClass()

Return Value

bool

at line 148
ClassType setInterface()

Return Value

ClassType

at line 155
bool isInterface()

Return Value

bool

at line 162
ClassType setTrait()

Return Value

ClassType

at line 169
bool isTrait()

Return Value

bool

at line 176
ClassType setType(string $type)

Parameters

string $type

Return Value

ClassType

at line 186
string getType()

Return Value

string

at line 193
ClassType setFinal(bool $state = true)

Parameters

bool $state

Return Value

ClassType

at line 200
bool isFinal()

Return Value

bool

at line 207
ClassType setAbstract(bool $state = true)

Parameters

bool $state

Return Value

ClassType

at line 214
bool isAbstract()

Return Value

bool

at line 224
ClassType setExtends(string|string[] $names)

Parameters

string|string[] $names

Return Value

ClassType

at line 236
string|string[] getExtends()

Return Value

string|string[]

at line 243
ClassType addExtend(string $name)

Parameters

string $name

Return Value

ClassType

at line 256
ClassType setImplements(array $names)

Parameters

array $names

Return Value

ClassType

at line 265
array getImplements()

Return Value

array

at line 272
ClassType addImplement(string $name)

Parameters

string $name

Return Value

ClassType

at line 281
ClassType removeImplement(string $name)

Parameters

string $name

Return Value

ClassType

at line 295
ClassType setTraits(array $names)

Parameters

array $names

Return Value

ClassType

at line 304
array getTraits()

Return Value

array

at line 311
array getTraitResolutions()

Return Value

array

at line 318
ClassType addTrait(string $name, array $resolutions = [])

Parameters

string $name
array $resolutions

Return Value

ClassType

at line 327
ClassType removeTrait(string $name)

Parameters

string $name

Return Value

ClassType

at line 338
ClassType addMember(Method|Property|Constant $member)

Parameters

Method|Property|Constant $member

Return Value

ClassType

at line 364
ClassType setConstants(array $consts)

Parameters

array $consts

Return Value

ClassType

at line 376
array getConstants()

Return Value

array

at line 382
Constant addConstant(string $name, $value)

Parameters

string $name
$value

Return Value

Constant

at line 389
ClassType removeConstant(string $name)

Parameters

string $name

Return Value

ClassType

at line 400
ClassType setProperties(array $props)

Parameters

array $props

Return Value

ClassType

at line 414
array getProperties()

Return Value

array

at line 420
Property getProperty(string $name)

Parameters

string $name

Return Value

Property

at line 432
Property addProperty(string $name, $value = null)

Parameters

string $name
$value

Return Value

Property

at line 442
ClassType removeProperty(string $name)

Parameters

string $name without $

Return Value

ClassType

at line 449
bool hasProperty(string $name)

Parameters

string $name

Return Value

bool

at line 459
ClassType setMethods(array $methods)

Parameters

array $methods

Return Value

ClassType

at line 473
array getMethods()

Return Value

array

at line 479
Method getMethod(string $name)

Parameters

string $name

Return Value

Method

at line 488
Method addMethod(string $name)

Parameters

string $name

Return Value

Method

at line 501
ClassType removeMethod(string $name)

Parameters

string $name

Return Value

ClassType

at line 508
bool hasMethod(string $name)

Parameters

string $name

Return Value

bool

at line 515
void validate()

Return Value

void

Exceptions

InvalidStateException

at line 536
__clone()