Componere 소개

Componere(라틴어, 영어: compose)는 프로덕션 환경을 대상으로 하며 클래스 구성, 원숭이 패치 및 캐스팅을 위한 API를 제공합니다.

Composition:

Componere\Definition은 런타임에 클래스를 정의(또는 재정의)하는 데 사용됩니다. 그런 다음 클래스를 등록할 수 있으며 재정의의 경우 Componere\Definition이 존재하는 한 원래 클래스를 대체합니다.


public Componere\Definition::__construct(string $name)

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

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

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


Patching:

Componere\Patch는 런타임에 개체의 특정 인스턴스 클래스를 변경하는 데 사용됩니다. 적용 시 패치는 Componere\Patch가 존재하는 한 적용된 상태로 유지되며 명시적으로 되돌릴 수 있습니다.


public Componere\Patch::__construct(object $instance)

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


Casting:

Componere\ 캐스팅 함수는 사용자 정의 호환 유형 간에 캐스팅할 수 있습니다. 여기서 호환 가능은 유형이 개체 유형의 하위 또는 상위임을 의미합니다.


Componere\cast(Type $type, $object): Type

Componere\cast_by_ref(Type $type, $object): Type