用AI赚第一桶💰低成本搭建一套AI赚钱工具,源码可二开。 广告
Patch类允许程序员在运行时更改实例的类型,而无需注册新的Definition 修补程序销毁后,它会还原,以便在修补程序生存期内修补的实例恢复为其正式类型。 ``` final Componere\Definition extends Componere\Abstract\Definition { /* Constructors */ public __construct ( string $name )//name:不区分大小写的类名 public __construct ( string $name , string $parent )//parent:不区分大小写的类名 public __construct ( string $name , array $interfaces )//interfaces:不区分大小写的类名数组 public __construct ( string $name , string $parent , array $interfaces ) /* 方法 */ public apply ( void ) : void - 应用当前补丁 public revert ( void ) : void - 恢复当前补丁 public isApplied ( void ) : bool - 状态检测 public derive ( object $instance ) : Patch - 为给定的实例派生一个补丁 public getClosure ( string $method_name ) : \Closure - 获取指定闭包(匿名函数) public getClosures ( void ) : 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 添加Trait public Componere\Abstract\Definition::getReflector ( void ) : \ReflectionClass 反射 } name:不区分大小写的类名 parent:不区分大小写的类名 interfaces:不区分大小写的类名数组 ```