- Fixed Notes bugs with Union Types Reflection
This commit is contained in:
parent
340235e2f8
commit
996c8fa14a
|
@ -65,13 +65,13 @@ class ObjectReflection {
|
||||||
|
|
||||||
if ( $traits = $this->classReflection->getTraits() ) {
|
if ( $traits = $this->classReflection->getTraits() ) {
|
||||||
foreach($traits as $key => $value) {
|
foreach($traits as $key => $value) {
|
||||||
$traitTags = array_merge_recursive($traitTags ?? [], static::fromClass($key)->gatherClass(true));
|
$traitTags = static::fromClass($key)->gatherClass(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $interfaces = $this->classReflection->getInterfaces() ) {
|
if ( $interfaces = $this->classReflection->getInterfaces() ) {
|
||||||
foreach($interfaces as $key => $value) {
|
foreach($interfaces as $key => $value) {
|
||||||
$interfaceTags = array_merge_recursive($interfaceTags ?? [], static::fromClass($key)->gatherClass(true));
|
$interfaceTags = static::fromClass($key)->gatherClass(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,10 +114,15 @@ class ObjectReflection {
|
||||||
$current['value'] = $defaultValues[ $current['name'] ];
|
$current['value'] = $defaultValues[ $current['name'] ];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( $property->hasType() ) {
|
if ( $property->hasType() ) {
|
||||||
$current['type'] = $property->getType()->getName();
|
$type = $property->getType();
|
||||||
$current['builtin'] = $property->getType()->isBuiltIn();
|
|
||||||
$current['nullable'] = $property->getType()->allowsNull();
|
if (! $type instanceof \ReflectionUnionType ) {
|
||||||
|
$current['type'] = $type->getName();
|
||||||
|
$current['builtin'] = $type->isBuiltIn();
|
||||||
|
$current['nullable'] = $type->allowsNull();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$current['tags'] = $this->annotationReader->getProperty($property);
|
$current['tags'] = $this->annotationReader->getProperty($property);
|
||||||
|
|
Loading…
Reference in New Issue