Skip to content

Commit

Permalink
Changed some enums that had reserved keys as name
Browse files Browse the repository at this point in the history
  • Loading branch information
milos-pejanovic-devtech committed Mar 7, 2017
1 parent 586146a commit e43d89a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Common/ModelReflection/Enum/AnnotationEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/Common/ModelReflection/Enum/TypeEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ class TypeEnum {
const INTEGER = 'integer';
const DOUBLE = 'double';
const STRING = 'string';
const ARRAY = 'array';
const ARR = 'array';
const OBJECT = 'object';
}
6 changes: 3 additions & 3 deletions src/Common/ModelReflection/ModelProperty.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -91,7 +91,7 @@ public function __construct(\ReflectionProperty $property, $parent, $parentNS) {
}
}

/**
/**::
* @param mixed $value
*/
public function setPropertyValue($value) {
Expand Down
2 changes: 1 addition & 1 deletion src/Common/ModelReflection/ModelPropertyType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit e43d89a

Please sign in to comment.