From 52d3d1a33d8c3ea705035314943e06ada10f5097 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Sat, 24 Apr 2021 20:20:01 +0800 Subject: [PATCH] modify --- Annotation/Loader.php | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/Annotation/Loader.php b/Annotation/Loader.php index 662f0fab..bb52b3f0 100644 --- a/Annotation/Loader.php +++ b/Annotation/Loader.php @@ -409,32 +409,18 @@ class Loader extends BaseObject } foreach ($annotations['methods'] as $name => $attribute) { foreach ($attribute as $value) { - $this->_execute($class, $annotation, $annotations['handler'], $value, $name); + if ($value instanceof Relation) { + $annotation->addRelate($annotations['handler'], $value->name, $name); + } else if ($value instanceof Get) { + $annotation->addGets($annotations['handler'], $value->name, $name); + } else if ($value instanceof Set) { + $annotation->addSets($annotations['handler'], $value->name, $name); + } else { + $value->execute([$class, $name]); + } } } } } - - /** - * @param $class - * @param $annotation - * @param $annotations - * @param $value - * @param $name - */ - private function _execute($class,Annotation $annotation, $handler, $value, $name) - { - if ($value instanceof Relation) { - $annotation->addRelate($handler, $value->name, $name); - } else if ($value instanceof Get) { - $annotation->addGets($handler, $value->name, $name); - } else if ($value instanceof Set) { - $annotation->addSets($handler, $value->name, $name); - } else { - $value->execute([$class, $name]); - } - } - - }