From b278f171757c18e20f97c863e2e165516c246519 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Wed, 23 Feb 2022 17:20:25 +0800 Subject: [PATCH] modify plugin name --- Target.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Target.php b/Target.php index 14a52a7..851dfaf 100644 --- a/Target.php +++ b/Target.php @@ -157,7 +157,13 @@ class Target /** @var ReflectionMethod $attributes */ $attributes = $this->methods[$property] ?? []; if (!empty($attributes)) { - return $attributes->getAttributes($annotation); + if (empty($annotation)) { + return $attributes->getAttributes(); + } + $anno = $attributes->getAttributes($annotation); + if (count($anno) > 0) { + return $anno[0]; + } } return []; }