|
Zhamao Framework 3.2.4
A high-performance chatbot + web framework
|
Public 成员函数 | |
| __construct (bool $with_internal_parsers=true) | |
| addSpecialParser (string $class_name, callable $callback) | |
| parse () | |
| generateAnnotationListFromMap () | |
| parseSpecial (object|string $annotation, ?array $same_method_annotations=null) | |
| addPsr4Path (string $path, string $indoor_name, array $join_groups=[]) | |
| getUsedTime () | |
| getAnnotationMap () | |
注解解析器
| __construct | ( | bool | $with_internal_parsers = true | ) |
| addPsr4Path | ( | string | $path, |
| string | $indoor_name, | ||
| array | $join_groups = [] |
||
| ) |
添加解析的路径
| string | $path | 注册解析注解的路径 |
| string | $indoor_name | 起始命名空间的名称 |
| array | $join_groups | 此类命名空间解析出来的注解要加入的组 |
| addSpecialParser | ( | string | $class_name, |
| callable | $callback | ||
| ) |
设置自定义的注解解析方法
| string | $class_name | 注解类名 |
| callable | $callback | 回调函数 |
| generateAnnotationListFromMap | ( | ) |
生成排序后的注解列表
| getAnnotationMap | ( | ) |
获取注解的注册map
| getUsedTime | ( | ) |
获取解析器调用的时间(秒)
| parse | ( | ) |
解析所有传入的 PSR-4 下识别出来的类及下方的注解 返回一个包含三个元素的数组,分别是list、map、tree 其中list为注解列表,key是注解的class名称,value是所有此注解的列表,即[Annotation1, ...] map是类、方法映射表关系的三维数组,即[类名 => [方法名 => [注解1, ...]]] tree是解析中间生成的树结构,内含反射对象,见下方注释
ReflectionException
| parseSpecial | ( | object|string | $annotation, |
| ?array | $same_method_annotations = null |
||
| ) |
单独解析特殊注解
| object | string | $annotation | 注解对象 |
| null | array | $same_method_annotations | 相同方法下的其他注解列表(可为数组或 null) |