From 8c088c338411635c4128411b1a013b67574bb196 Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Sun, 29 Aug 2021 04:24:06 +0800 Subject: [PATCH] 111 --- core/Di/Attributes.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/Di/Attributes.php b/core/Di/Attributes.php index 8ebdeabc..f914df9c 100644 --- a/core/Di/Attributes.php +++ b/core/Di/Attributes.php @@ -183,12 +183,12 @@ trait Attributes */ private function format_annotation(ReflectionAttribute $attribute) { - $attr = new ReflectionClass($attribute->getName()); + $reflection_class = new ReflectionClass($attribute->getName()); $argument = $attribute->getArguments(); $array = ['class' => $attribute->getName(), 'params' => []]; - foreach ($attr->getConstructor()->getParameters() as $key => $parameter) { + foreach ($reflection_class->getConstructor()->getParameters() as $key => $parameter) { if (isset($argument[$parameter->getName()])) { $array['params'][$parameter->getName()] = $argument[$parameter->getName()]; } else { @@ -199,6 +199,9 @@ trait Attributes } } } + + unset($reflection_class); + return $array; }