mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-17 20:54:52 +08:00
add addSingleAnnotation for AnnotationMap
This commit is contained in:
parent
6854304d64
commit
9867004c7d
@ -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[]
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user