final class ClassType

Class/Interface/Trait/Enum description.

Constants

TYPE_CLASS

TYPE_INTERFACE

TYPE_TRAIT

TYPE_ENUM

VisibilityPublic

VisibilityProtected

VisibilityPrivate

VISIBILITY_PUBLIC

VISIBILITY_PROTECTED

VISIBILITY_PRIVATE

Properties

Method[] $methods
Property[] $properties

Methods

static ClassType
class(string|null $name)

No description

static ClassType
interface(string $name)

No description

static ClassType
trait(string $name)

No description

static ClassType
enum(string $name)

No description

static ClassType
from(string|object $class, bool $withBodies = false, bool $materializeTraits = true)

No description

static ClassType
withBodiesFrom(string|object $class)

No description

static ClassType
fromCode(string $code)

No description

__construct(string|null $name = null, PhpNamespace|null $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() deprecated

No description

bool
isClass()

No description

setInterface()

No description

bool
isInterface()

No description

setTrait()

No description

bool
isTrait()

No description

bool
isEnum()

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 $traits)

No description

array
getTraits()

No description

array
getTraitResolutions()

No description

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

No description

removeTrait(string $name)

No description

setConstants(array $consts)

No description

array
getConstants()

No description

addConstant(string $name, $value)

No description

removeConstant(string $name)

No description

setCases(array $cases)

Sets cases to enum

array
getCases()

No description

addCase(string $name, $value = null)

Adds case to enum

removeCase(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 80
static ClassType class(string|null $name)

No description

Parameters

string|null $name

Return Value

ClassType

at line 86
static ClassType interface(string $name)

No description

Parameters

string $name

Return Value

ClassType

at line 92
static ClassType trait(string $name)

No description

Parameters

string $name

Return Value

ClassType

at line 98
static ClassType enum(string $name)

No description

Parameters

string $name

Return Value

ClassType

at line 107
static ClassType from(string|object $class, bool $withBodies = false, bool $materializeTraits = true)

No description

Parameters

string|object $class
bool $withBodies
bool $materializeTraits

Return Value

ClassType

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

No description

Parameters

string|object $class

Return Value

ClassType

at line 124
static ClassType fromCode(string $code)

No description

Parameters

string $code

Return Value

ClassType

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

No description

Parameters

string|null $name
PhpNamespace|null $namespace

at line 138
string __toString()

No description

Return Value

string

at line 154
PhpNamespace|null getNamespace() deprecated

deprecated an object can be in multiple namespaces

No description

Return Value

PhpNamespace|null

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

No description

Parameters

string|null $name

Return Value

ClassType

at line 172
string|null getName()

No description

Return Value

string|null

at line 179
ClassType setClass() deprecated

deprecated

No description

Return Value

ClassType

at line 186
bool isClass()

No description

Return Value

bool

at line 193
ClassType setInterface()

No description

Return Value

ClassType

at line 200
bool isInterface()

No description

Return Value

bool

at line 207
ClassType setTrait()

No description

Return Value

ClassType

at line 214
bool isTrait()

No description

Return Value

bool

at line 220
bool isEnum()

No description

Return Value

bool

at line 227
ClassType setType(string $type)

No description

Parameters

string $type

Return Value

ClassType

at line 238
string getType()

No description

Return Value

string

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

No description

Parameters

bool $state

Return Value

ClassType

at line 252
bool isFinal()

No description

Return Value

bool

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

No description

Parameters

bool $state

Return Value

ClassType

at line 266
bool isAbstract()

No description

Return Value

bool

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

No description

Parameters

string|string[] $names

Return Value

ClassType

at line 289
string|string[] getExtends()

No description

Return Value

string|string[]

at line 296
ClassType addExtend(string $name)

No description

Parameters

string $name

Return Value

ClassType

at line 309
ClassType setImplements(array $names)

No description

Parameters

array $names

Return Value

ClassType

at line 318
array getImplements()

No description

Return Value

array

at line 325
ClassType addImplement(string $name)

No description

Parameters

string $name

Return Value

ClassType

at line 334
ClassType removeImplement(string $name)

No description

Parameters

string $name

Return Value

ClassType

at line 345
ClassType setTraits(array $traits)

No description

Parameters

array $traits

Return Value

ClassType

at line 361
array getTraits()

No description

Return Value

array

at line 368
array getTraitResolutions()

internal  
 

No description

Return Value

array

at line 378
ClassType|TraitUse addTrait(string $name, array|bool $resolutions = [])

No description

Parameters

string $name
array|bool $resolutions

Return Value

ClassType|TraitUse

at line 393
ClassType removeTrait(string $name)

No description

Parameters

string $name

Return Value

ClassType

at line 404
ClassType addMember(Method|Property|Constant|EnumCase|TraitUse $member)

No description

Parameters

Method|Property|Constant|EnumCase|TraitUse $member

Return Value

ClassType

at line 437
ClassType setConstants(array $consts)

No description

Parameters

array $consts

Return Value

ClassType

at line 453
array getConstants()

No description

Return Value

array

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

No description

Parameters

string $name
$value

Return Value

Constant

at line 468
ClassType removeConstant(string $name)

No description

Parameters

string $name

Return Value

ClassType

at line 480
ClassType setCases(array $cases)

Sets cases to enum

Parameters

array $cases

Return Value

ClassType

at line 493
array getCases()

No description

Return Value

array

at line 500
EnumCase addCase(string $name, $value = null)

Adds case to enum

Parameters

string $name
$value

Return Value

EnumCase

at line 508
ClassType removeCase(string $name)

No description

Parameters

string $name

Return Value

ClassType

at line 519
ClassType setProperties(array $props)

No description

Parameters

array $props

Return Value

ClassType

at line 532
array getProperties()

No description

Return Value

array

at line 538
Property getProperty(string $name)

No description

Parameters

string $name

Return Value

Property

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

No description

Parameters

string $name

without $

$value

Return Value

Property

at line 563
ClassType removeProperty(string $name)

No description

Parameters

string $name

without $

Return Value

ClassType

at line 570
bool hasProperty(string $name)

No description

Parameters

string $name

Return Value

bool

at line 580
ClassType setMethods(array $methods)

No description

Parameters

array $methods

Return Value

ClassType

at line 593
array getMethods()

No description

Return Value

array

at line 604
Method getMethod(string $name)

No description

Parameters

string $name

Return Value

Method

at line 615
Method addMethod(string $name)

No description

Parameters

string $name

Return Value

Method

at line 629
ClassType removeMethod(string $name)

No description

Parameters

string $name

Return Value

ClassType

at line 636
bool hasMethod(string $name)

No description

Parameters

string $name

Return Value

bool

at line 643
void validate()

No description

Return Value

void

Exceptions

InvalidStateException

at line 667
__clone()

No description

Traits