This commit is contained in:
as2252258@163.com
2021-09-20 01:24:32 +08:00
parent 3a596f34f8
commit da71345f1e
2 changed files with 6 additions and 2 deletions
+5 -2
View File
@@ -214,8 +214,11 @@ class NoteManager
public static function getSpecify_annotation(string $attribute, string $class, string $method = null): mixed public static function getSpecify_annotation(string $attribute, string $class, string $method = null): mixed
{ {
$class = self::getAttributeTrees($attribute, $class); $class = self::getAttributeTrees($attribute, $class);
if (empty($class) || !isset($class['method']) || empty($method)) { if (empty($class) || !isset($class['method'])){
return $class['method'] ?? []; return null;
}
if (empty($method)) {
return $class['method'];
} }
foreach ($class['method'] as $value) { foreach ($class['method'] as $value) {
$key = key($value); $key = key($value);
+1
View File
@@ -46,6 +46,7 @@ class AspectProxy extends AProxy implements ProxyInterface
{ {
$aspect = NoteManager::getSpecify_annotation(Aspect::class, $executor[0], $executor[1]); $aspect = NoteManager::getSpecify_annotation(Aspect::class, $executor[0], $executor[1]);
if (!is_null($aspect)) { if (!is_null($aspect)) {
var_dump($aspect);
$aspect = Kiri::getDi()->get($aspect->aspect); $aspect = Kiri::getDi()->get($aspect->aspect);
} }
return $aspect; return $aspect;