From 9df0ff168a5772f6a2886df2469ea8f723ca34cf Mon Sep 17 00:00:00 2001 From: "as2252258@163.com" Date: Thu, 8 Apr 2021 02:27:39 +0800 Subject: [PATCH] modify --- Annotation/Loader.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Annotation/Loader.php b/Annotation/Loader.php index 1ab7c0e6..34939aea 100644 --- a/Annotation/Loader.php +++ b/Annotation/Loader.php @@ -356,13 +356,9 @@ class Loader extends BaseObject if ($annotations === null) { continue; } - - if (isset($annotations['target']) && !empty($annotations['target'])) { - foreach ($annotations['target'] as $value) { - $value->execute([$annotations['handler']]); - } + foreach ($annotations['target'] ?? [] as $value) { + $value->execute([$annotations['handler']]); } - foreach ($annotations['methods'] as $name => $attribute) { foreach ($attribute as $value) { if (!($value instanceof \Annotation\Attribute)) {