This commit is contained in:
as2252258@163.com
2021-04-24 16:29:55 +08:00
parent ba8cd63b5c
commit eca0de70ed
+5 -3
View File
@@ -172,6 +172,9 @@ class Loader extends BaseObject
}
$replace = Snowflake::getDi()->getReflect($this->explodeFileName($path, $namespace));
var_dump($replace->getName() . '::' . $replace->getAttributes(Target::class));
if (empty($replace) || !$replace->getAttributes(Target::class)) {
return;
}
@@ -398,13 +401,12 @@ class Loader extends BaseObject
if ($annotations === null) {
continue;
}
$handler = $annotations['handler']->newInstance();
foreach ($annotations['target'] ?? [] as $value) {
$value->execute([$handler]);
$value->execute([$annotations['handler']]);
}
foreach ($annotations['methods'] as $name => $attribute) {
foreach ($attribute as $value) {
$value->execute([$handler, $name]);
$value->execute([$annotations['handler'], $name]);
}
}
}