final class ClassManipulator

Provides advanced manipulation of a ClassType, such as inheriting members from parent classes or implementing interfaces.

Methods

__construct(ClassType $class)

No description

inheritProperty(string $name, bool $returnIfExists = false)

Copies a property from a parent class into this class for overriding.

inheritMethod(string $name, bool $returnIfExists = false)

Copies a method from a parent class or interface into this class for overriding.

void
implement(string $name)

Adds stub implementations for all abstract methods and properties from the given interface or abstract class.

Details

at line 19
__construct(ClassType $class)

No description

Parameters

ClassType $class

at line 29
Property inheritProperty(string $name, bool $returnIfExists = false)

Copies a property from a parent class into this class for overriding.

Parameters

string $name
bool $returnIfExists

Return Value

Property

Exceptions

InvalidStateException

at line 58
Method inheritMethod(string $name, bool $returnIfExists = false)

Copies a method from a parent class or interface into this class for overriding.

Parameters

string $name
bool $returnIfExists

Return Value

Method

Exceptions

InvalidStateException

at line 86
void implement(string $name)

Adds stub implementations for all abstract methods and properties from the given interface or abstract class.

Parameters

string $name

Return Value

void