From 63741bacbb79ec4f2b16a78239df1a307ec87320 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Sat, 24 Apr 2021 20:23:28 +0800 Subject: [PATCH] modify --- Annotation/Loader.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Annotation/Loader.php b/Annotation/Loader.php index f08b3b75..bd485dc4 100644 --- a/Annotation/Loader.php +++ b/Annotation/Loader.php @@ -181,7 +181,7 @@ class Loader extends BaseObject } $this->appendFileToDirectory($path->getRealPath(), $replace->getName()); - $_array = ['handler' => $replace->getName(), 'target' => [], 'methods' => [], 'property' => []]; + $_array = ['handler' => $replace->newInstance(), 'target' => [], 'methods' => [], 'property' => []]; foreach ($replace->getAttributes() as $attribute) { if ($attribute->getName() == Attribute::class) { continue; @@ -403,13 +403,12 @@ class Loader extends BaseObject if ($annotations === null) { continue; } - $class = Snowflake::createObject($annotations['handler']); foreach ($annotations['target'] ?? [] as $value) { - $value->execute([$class]); + $value->execute([$annotations['handler']]); } foreach ($annotations['methods'] as $name => $attribute) { foreach ($attribute as $value) { - $value->execute([$class, $name]); + $value->execute([$annotations['handler'], $name]); // // if ($value instanceof Relation) { // $annotation->addRelate($annotations['handler'], $value->name, $name);