This commit is contained in:
2023-08-03 14:06:28 +08:00
parent d7ab423a0a
commit b55d513f5b
+2 -1
View File
@@ -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());
}
}