改名
This commit is contained in:
@@ -162,16 +162,27 @@ class Annotation extends Component
|
|||||||
{
|
{
|
||||||
$property = $reflectionClass->getProperties();
|
$property = $reflectionClass->getProperties();
|
||||||
foreach ($property as $value) {
|
foreach ($property as $value) {
|
||||||
|
if ($value->isStatic()) continue;
|
||||||
$attributes = $value->getAttributes();
|
$attributes = $value->getAttributes();
|
||||||
if (count($attributes) < 1) {
|
if (count($attributes) < 1) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
foreach ($attributes as $attribute) {
|
foreach ($attributes as $attribute) {
|
||||||
$attribute = $this->instance($attribute);
|
/** @var IAnnotation $annotation */
|
||||||
if (empty($attribute)) {
|
$annotation = $this->instance($attribute);
|
||||||
|
if (empty($annotation)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$value->setValue($attribute->execute([$object, $value->getName()]));
|
$annotation = $annotation->execute([$object, $value->getName()]);
|
||||||
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user