改名
This commit is contained in:
@@ -167,22 +167,11 @@ class Annotation extends Component
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
foreach ($attributes as $attribute) {
|
foreach ($attributes as $attribute) {
|
||||||
/** @var IAnnotation $annotation */
|
$attribute = $this->instance($attribute);
|
||||||
$annotation = $attribute->newInstance()->execute([$object, $value->getName()]);
|
if (empty($attribute)) {
|
||||||
// if ($value->isStatic()) {
|
continue;
|
||||||
// $name = $value->getName();
|
|
||||||
//
|
|
||||||
// $object::$name = $annotation;
|
|
||||||
// } else
|
|
||||||
if ($value->isPublic()) {
|
|
||||||
$object->{$value->getName()} = $annotation;
|
|
||||||
} else {
|
|
||||||
$name = 'set' . ucfirst($value->getName());
|
|
||||||
if (!method_exists($object, $name)) {
|
|
||||||
throw new NotFindPropertyException('set property need method ' . $name);
|
|
||||||
}
|
|
||||||
$object->$name($annotation);
|
|
||||||
}
|
}
|
||||||
|
$value->setValue($attribute->execute([$object, $value->getName()]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user