This commit is contained in:
as2252258@163.com
2021-08-29 04:24:06 +08:00
parent 2108ec7613
commit 8c088c3384
+5 -2
View File
@@ -183,12 +183,12 @@ trait Attributes
*/
private function format_annotation(ReflectionAttribute $attribute)
{
$attr = new ReflectionClass($attribute->getName());
$reflection_class = new ReflectionClass($attribute->getName());
$argument = $attribute->getArguments();
$array = ['class' => $attribute->getName(), 'params' => []];
foreach ($attr->getConstructor()->getParameters() as $key => $parameter) {
foreach ($reflection_class->getConstructor()->getParameters() as $key => $parameter) {
if (isset($argument[$parameter->getName()])) {
$array['params'][$parameter->getName()] = $argument[$parameter->getName()];
} else {
@@ -199,6 +199,9 @@ trait Attributes
}
}
}
unset($reflection_class);
return $array;
}