mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-02 14:25:38 +08:00
add addSingleAnnotation for AnnotationMap
This commit is contained in:
@@ -37,6 +37,19 @@ class AnnotationMap
|
||||
self::$_map = array_merge_recursive(self::$_map, $map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加一个独立的注解到全局注解列表中
|
||||
*
|
||||
* @param AnnotationBase $annotation 注解对象
|
||||
*/
|
||||
public static function addSingleAnnotation(AnnotationBase $annotation): void
|
||||
{
|
||||
self::$_list[get_class($annotation)][] = $annotation;
|
||||
if ($annotation->class !== '') {
|
||||
self::$_map[$annotation->class][$annotation->method][] = $annotation;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return AnnotationBase[]
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user