This commit is contained in:
2023-08-03 14:02:06 +08:00
parent e1f76a476e
commit d7ab423a0a
+11 -1
View File
@@ -108,7 +108,17 @@ class Container implements ContainerInterface
if (isset($this->_singletons[$id])) {
return;
}
$this->make($id);
$object = $this->make($id);
$methods = $this->getReflectionClass($id);
foreach ($methods->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
if ($method->isStatic()) {
continue;
}
$attributes = $method->getAttributes();
foreach ($attributes as $attribute) {
$attribute->newInstance()->dispatch($object, $method->getName());
}
}
}