diff --git a/src/Common/ModelReflection/Enum/AnnotationEnum.php b/src/Common/ModelReflection/Enum/AnnotationEnum.php index 9bcfcac..1807ef3 100644 --- a/src/Common/ModelReflection/Enum/AnnotationEnum.php +++ b/src/Common/ModelReflection/Enum/AnnotationEnum.php @@ -9,7 +9,7 @@ namespace Common\ModelReflection\Enum; class AnnotationEnum { - const VAR = 'var'; + const VARIABLE = 'var'; const NAME = 'name'; const REQUIRED = 'required'; const RULE = 'rule'; diff --git a/src/Common/ModelReflection/Enum/TypeEnum.php b/src/Common/ModelReflection/Enum/TypeEnum.php index c2b8221..06b236d 100644 --- a/src/Common/ModelReflection/Enum/TypeEnum.php +++ b/src/Common/ModelReflection/Enum/TypeEnum.php @@ -15,6 +15,6 @@ class TypeEnum { const INTEGER = 'integer'; const DOUBLE = 'double'; const STRING = 'string'; - const ARRAY = 'array'; + const ARR = 'array'; const OBJECT = 'object'; } \ No newline at end of file diff --git a/src/Common/ModelReflection/ModelProperty.php b/src/Common/ModelReflection/ModelProperty.php index 37d8a1c..3d57586 100644 --- a/src/Common/ModelReflection/ModelProperty.php +++ b/src/Common/ModelReflection/ModelProperty.php @@ -78,8 +78,8 @@ public function __construct(\ReflectionProperty $property, $parent, $parentNS) { $propertyType = gettype($this->property->getValue($parent)); $annotatedType = TypeEnum::ANY; - if($this->docBlock->hasAnnotation(AnnotationEnum::VAR) && !Validation::isEmpty($this->docBlock->getFirstAnnotation(AnnotationEnum::VAR))) { - $annotatedType = $this->docBlock->getFirstAnnotation(AnnotationEnum::VAR); + if($this->docBlock->hasAnnotation(AnnotationEnum::VARIABLE) && !Validation::isEmpty($this->docBlock->getFirstAnnotation(AnnotationEnum::VARIABLE))) { + $annotatedType = $this->docBlock->getFirstAnnotation(AnnotationEnum::VARIABLE); } $this->type = new ModelPropertyType($propertyType, $annotatedType, $parentNS); @@ -91,7 +91,7 @@ public function __construct(\ReflectionProperty $property, $parent, $parentNS) { } } - /** + /**:: * @param mixed $value */ public function setPropertyValue($value) { diff --git a/src/Common/ModelReflection/ModelPropertyType.php b/src/Common/ModelReflection/ModelPropertyType.php index 2d83e6b..ff7284b 100644 --- a/src/Common/ModelReflection/ModelPropertyType.php +++ b/src/Common/ModelReflection/ModelPropertyType.php @@ -54,7 +54,7 @@ public function __construct($propertyType, $annotatedType, $parentNS) { $this->actualType = TypeEnum::OBJECT; } if(strpos($this->annotatedType, '[]') !== false) { - $this->actualType = TypeEnum::ARRAY; + $this->actualType = TypeEnum::ARR; } }