From 4a168cb4a02320c2a764a35d2e40676832d91ee9 Mon Sep 17 00:00:00 2001 From: whwyy Date: Mon, 18 Dec 2023 21:30:40 +0800 Subject: [PATCH] eee --- Scanner.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Scanner.php b/Scanner.php index bef6caa..277a5dd 100644 --- a/Scanner.php +++ b/Scanner.php @@ -100,12 +100,14 @@ class Scanner extends Component if (in_array(Skip::class, $attributes) || in_array(\Attribute::class, $attributes)) { return; } - $object = $this->container->parse($class); foreach ($reflect->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { if ($method->isStatic() || $method->getDeclaringClass()->getName() != $class) { continue; } $attributes = $method->getAttributes(); + if (count($attributes) > 0) { + $object = $this->container->parse($class); + } foreach ($attributes as $attribute) { if (!class_exists($attribute->getName())) { continue;