diff --git a/src/Common/ReflectedPropertyType.php b/src/Common/ReflectedPropertyType.php index 7cc438b..3de1da5 100644 --- a/src/Common/ReflectedPropertyType.php +++ b/src/Common/ReflectedPropertyType.php @@ -18,4 +18,14 @@ class ReflectedPropertyType return $this->type === $type; } + + public function isObject() : bool + { + return ! $this->builtIn && class_exists($this->type); + } + + public function isEnum() : bool + { + return ! $this->builtIn && enum_exists($this->type); + } } \ No newline at end of file diff --git a/src/Common/ReflectedPropertyType.php~ b/src/Common/ReflectedPropertyType.php~ new file mode 100644 index 0000000..de520f2 --- /dev/null +++ b/src/Common/ReflectedPropertyType.php~ @@ -0,0 +1,26 @@ +nullable) { + return true; + } + + return $this->type === $type; + } + + public function isObject() : bool + { + return ! $this->builtIn && class_exists($this->type); + } +} \ No newline at end of file