From cb70c7f885ea5f2adcb645f0eab76dfc6c0ae544 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 21 Jul 2021 14:43:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Annotation/Loader.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Annotation/Loader.php b/Annotation/Loader.php index 279f13f2..8c5085bb 100644 --- a/Annotation/Loader.php +++ b/Annotation/Loader.php @@ -342,26 +342,25 @@ class Loader extends BaseObject $annotation = Snowflake::getAnnotation(); foreach ($classes as $className) { - $annotations = static::$_classes[$className] ?? null; - if ($annotations === null) { + if (!isset(static::$_methods[$className])) { continue; } foreach (static::$_methods[$className] as $name => $attribute) { - $this->methods($annotations, $attribute, $annotation, $className, $name); + $this->methods($attribute, $annotation, $className, $name); } } } /** - * @param $annotations * @param $attribute * @param $annotation * @param $className * @param $name */ - private function methods($annotations, $attribute, $annotation, $className, $name) + private function methods($attribute, $annotation, $className, $name) { + $handler = static::$_classes[$className]['handler']; foreach ($attribute as $value) { if ($value instanceof Relation) { $annotation->addRelate($className, $value->name, $name); @@ -370,7 +369,7 @@ class Loader extends BaseObject } else if ($value instanceof Set) { $annotation->addSets($className, $value->name, $name); } else { - $value->execute($annotations['handler'], $name); + $value->execute($handler, $name); } } }