From 8fb592874741cca2e3c3943aac9729d1c3c07dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 22 Feb 2021 19:36:40 +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/Annotation.php | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Annotation/Annotation.php b/Annotation/Annotation.php index 512721ec..b9b25363 100644 --- a/Annotation/Annotation.php +++ b/Annotation/Annotation.php @@ -144,16 +144,20 @@ class Annotation extends Component private function resolveMethod(ReflectionClass $reflect, $class, $alias, $object) { var_dump($reflect->getName()); - foreach ($reflect->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { - if ($method->class != $class) { - continue; - } + try { + foreach ($reflect->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { + if ($method->class != $class) { + continue; + } - $tmp = $this->resolveAnnotations($method, $alias, $object); - if (empty($tmp)) { - continue; + $tmp = $this->resolveAnnotations($method, $alias, $object); + if (empty($tmp)) { + continue; + } + $this->_classes[$reflect->getName()][$method->getName()] = $tmp; } - $this->_classes[$reflect->getName()][$method->getName()] = $tmp; + } catch (\Throwable $throwable) { + $this->addError($throwable); } $this->resolveProperty($reflect, $object); }