略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: Componere\Patch

2024-11-14

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 __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
}

目录

add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/class.componere-patch.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3