« Componere\Definition::getClosures
Componere\Patch::__construct »

The Componere\Patch class

(Componere 2 >= 2.1.0)

はじめに

The Patch class allows the programmer to change the type of an instance at runtime without registering a new Definition

When a Patch is destroyed it is reverted, so that instances that were patched during the lifetime of the Patch are restored to their formal type.

クラス概要

final class Componere\Patch extends Componere\Abstract\Definition {
/* Constructors */
public function __construct(object $instance)
public function __construct(object $instance, array $interfaces)
/* メソッド */
public function apply(): void
public function revert(): void
public function isApplied(): bool
public function derive(object $instance): Patch
public function getClosure(string $name): Closure
public function getClosures(): array
/* 継承したメソッド */
public function Componere\Abstract\Definition::addInterface(string $interface): Definition
public function Componere\Abstract\Definition::addMethod(string $name, Componere\Method $method): Definition
public function Componere\Abstract\Definition::addTrait(string $trait): Definition
}

目次

関連キーワード:
Componere   Patch   Definition   Abstract   construct   instance   getClosures   type   apply   revert   isApplied   derive   getClosure   Closure   allows   programmer   change   runtime   without   registering   destroyed   reverted   instances   were   patched
関連する関数・ページ:
class.componere-definition   componere-patch.derive   componere-patch.apply   componere-definition.getclosures   componere-patch.construct   componere-patch.isapplied