From de670304b500b594e39670ffc284894b8134e9ab Mon Sep 17 00:00:00 2001 From: whwyy Date: Mon, 18 Dec 2023 17:18:54 +0800 Subject: [PATCH] eee --- Scanner.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Scanner.php b/Scanner.php index 7198f10..bef6caa 100644 --- a/Scanner.php +++ b/Scanner.php @@ -93,11 +93,14 @@ class Scanner extends Component if (class_exists($class)) { $reflect = $this->container->getReflectionClass($class); if ($reflect->isInstantiable()) { + if ($reflect->isTrait() || $reflect->isEnum()) { + return; + } $attributes = $this->skipNames($reflect); if (in_array(Skip::class, $attributes) || in_array(\Attribute::class, $attributes)) { return; } - $object = $this->container->parse($class); + $object = $this->container->parse($class); foreach ($reflect->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { if ($method->isStatic() || $method->getDeclaringClass()->getName() != $class) { continue;