PHP8 The Componere\Patch class
2023-08-29 16:47 更新
(Componere 2 >= 2.1.0)
简介
Patch 类允许程序员在运行时更改实例的类型,而无需注册新的定义
当补丁被销毁时,它会被恢复,以便在补丁的生命周期内修补的实例恢复到其正式类型。
类摘要
final class Componere\Patch extends Componere\Abstract\Definition {
/* Constructors */
public __construct(object $instance)
public __construct(object $instance, array $interfaces)
/* 方法 */
public apply(): void
public revert(): void
public isApplied(): bool
public derive(object $instance): Patch
public getClosure(string $name): Closure
public getClosures(): array
/* 继承的方法 */
public Componere\Abstract\Definition::addInterface(string $interface): Definition
public Componere\Abstract\Definition::addMethod(string $name, Componere\Method $method): Definition
public Componere\Abstract\Definition::addTrait(string $trait): Definition
public Componere\Abstract\Definition::getReflector(): ReflectionClass
}
目录
- Componere\Patch::__construct — Patch Construction
- Componere\Patch::apply — Application
- Componere\Patch::revert — Reversal
- Componere\Patch::isApplied — State Detection
- Componere\Patch::derive — Patch Derivation
- Componere\Patch::getClosure — Get Closure
- Componere\Patch::getClosures — Get Closures
以上内容是否对您有帮助:
更多建议: