diff --git a/src/Common/ModelReflection/ModelClass.php b/src/Common/ModelReflection/ModelClass.php index 5fcf579..44b2674 100644 --- a/src/Common/ModelReflection/ModelClass.php +++ b/src/Common/ModelReflection/ModelClass.php @@ -8,6 +8,7 @@ namespace Common\ModelReflection; use Common\Util\Validation; +use Common\ModelReflection\Enum\AnnotationEnum; class ModelClass { diff --git a/src/Common/ModelReflection/ModelProperty.php b/src/Common/ModelReflection/ModelProperty.php index ffab78f..f7da206 100644 --- a/src/Common/ModelReflection/ModelProperty.php +++ b/src/Common/ModelReflection/ModelProperty.php @@ -8,6 +8,8 @@ namespace Common\ModelReflection; use Common\Util\Validation; +use Common\ModelReflection\Enum\TypeEnum; +use Common\ModelReflection\Enum\AnnotationEnum; class ModelProperty { diff --git a/src/Common/ModelReflection/ModelPropertyType.php b/src/Common/ModelReflection/ModelPropertyType.php index 1be1ec3..afd3b75 100644 --- a/src/Common/ModelReflection/ModelPropertyType.php +++ b/src/Common/ModelReflection/ModelPropertyType.php @@ -8,6 +8,7 @@ namespace Common\ModelReflection; use Common\Util\Validation; +use Common\ModelReflection\Enum\TypeEnum; class ModelPropertyType { diff --git a/src/Common/Util/Validation.php b/src/Common/Util/Validation.php index 38e995b..cd326d5 100644 --- a/src/Common/Util/Validation.php +++ b/src/Common/Util/Validation.php @@ -37,7 +37,7 @@ public static function isEmpty($value) { */ public static function isCustomType(string $type) { $result = true; - $simpleTypes = ['NULL', 'boolean', 'bool', 'int', 'integer', 'double', 'string', 'array', 'object', 'boolean[]', + $simpleTypes = ['any', 'NULL', 'boolean', 'bool', 'int', 'integer', 'double', 'string', 'array', 'object', 'boolean[]', 'integer[]', 'double[]', 'string[]', '[]', 'object[]']; foreach($simpleTypes as $simpleType) { if($type == $simpleType) { diff --git a/tests/Common/ModelReflection/ModelPropertyTypeTest.php b/tests/Common/ModelReflection/ModelPropertyTypeTest.php index 01db942..2aea5cd 100644 --- a/tests/Common/ModelReflection/ModelPropertyTypeTest.php +++ b/tests/Common/ModelReflection/ModelPropertyTypeTest.php @@ -128,7 +128,7 @@ public function testGetModelClassName($index, $isModel, $propertyType, $annotate public function validValues() { return [ - [0, false, 'NULL', 'NULL', 'NULL', ''], + [0, false, 'NULL', 'any', 'any', ''], [1, false, 'boolean', 'boolean', 'boolean', ''], [2, false, 'boolean', 'boolean', 'boolean', ''], [3, false, 'string', 'string', 'string', ''],