« APCUIterator::valid
インストール/設定 »

Componere

はじめに

Componere (latin, English: compose) targets production environments and provides an API for composition of classes, monkey patching, and casting.

Composition:

Componere\Definition is used to define (or redefine) a class at runtime; The class can then be registered, and in the case of redefinition it replaces the original class for as long as the Componere\Definition exists.

public function Componere\Definition::__construct(string $name, string $parent)
public function Componere\Definition::__construct(string $name, array $interfaces)
public function Componere\Definition::__construct(string $name, string $parent, array $interfaces)

Patching:

Componere\Patch is used to change the class of a specific instance of an object at runtime; Upon application the patch will remain applied for as long as the Componere\Patch exists, and can be reverted explicitly.

public function Componere\Patch::__construct(object $instance)
public function Componere\Patch::__construct(object $instance, array $interfaces)

Casting:

Componere\ casting functions can cast among user defined compatible types; Where compatible means Type is sub or super to the type of object.

function Componere\cast(string $type, object $object): object
function Componere\cast_by_ref(string $type, object $object): object

関連キーワード:
Componere   Definition   Patch   construct   Method   Accessibility   Abstract   Modification   cast   Detection   Construction   interfaces   instance   Casting   type   casting   used   runtime   long   exists   parent   compatible   getReflector   Reflection   State
関連する関数・ページ:
class.componere-patch   class.componere-method   componere-method.setstatic   componere-method.setprivate   componere-abstract-definition.addmethod   componere-method.setprotected