PHP8 The Componere\Definition class
2023-08-29 14:51 更新
(Componere 2 >= 2.1.0)
简介
Definition 类允许程序员在运行时构建和注册类型。
如果定义替换现有类,则当定义被销毁时,现有类将被恢复。
类摘要
final class Componere\Definition extends Componere\Abstract\Definition {
/* Constructors */
public __construct(string $name)
public __construct(string $name, string $parent)
public __construct(string $name, array $interfaces)
public __construct(string $name, string $parent, array $interfaces)
/* 方法 */
public addConstant(string $name, Componere\Value $value): Definition
public addProperty(string $name, Componere\Value $value): Definition
public register(): void
public isRegistered(): bool
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\Definition::__construct — Definition Construction
- Componere\Definition::addConstant — Add Constant
- Componere\Definition::addProperty — Add Property
- Componere\Definition::register — Registration
- Componere\Definition::isRegistered — State Detection
- Componere\Definition::getClosure — Get Closure
- Componere\Definition::getClosures — Get Closures
以上内容是否对您有帮助:
更多建议: