From b55d513f5b68c82e2bb9b970eee89b14fccc82e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Thu, 3 Aug 2023 14:06:28 +0800 Subject: [PATCH] qqq --- Container.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Container.php b/Container.php index 898933c..2ed229c 100644 --- a/Container.php +++ b/Container.php @@ -111,11 +111,12 @@ class Container implements ContainerInterface $object = $this->make($id); $methods = $this->getReflectionClass($id); foreach ($methods->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { - if ($method->isStatic()) { + if ($method->isStatic() || $method->getDeclaringClass()->getName() != $id) { continue; } $attributes = $method->getAttributes(); foreach ($attributes as $attribute) { + var_dump($attribute->getName()); $attribute->newInstance()->dispatch($object, $method->getName()); } }