You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This introduces ReflectionUnionType extends ReflectionType. https://wiki.php.net/rfc/union_types_v2#reflection - ReflectionUnionType->getTypes() should be used if it exists. (similar to how phpdoc union types are used).
The existing code wouldn't work, because $class = (string)$paramType would contain |.
Also, I think that nullable types may get converted to ?stdClass in 8.0 in nullable types of union types
if ($paramType instanceof ReflectionNamedType) {
// We have object data to map and want the class name.
// This should not include the `?` if the type was nullable.
$class = $paramType->getName();
} else {
// Fallback for php 7.0, which is still supported (and doesn't have nullable).
$class = (string)$paramType;
}
$value = $this->mapper->map($value, new $class());
The text was updated successfully, but these errors were encountered:
https://wiki.php.net/rfc/union_types_v2 was merged.
This introduces
ReflectionUnionType extends ReflectionType
. https://wiki.php.net/rfc/union_types_v2#reflection - ReflectionUnionType->getTypes() should be used if it exists. (similar to how phpdoc union types are used).The existing code wouldn't work, because
$class = (string)$paramType
would contain|
.Also, I think that nullable types may get converted to
?stdClass
in 8.0 in nullable types of union typesThe text was updated successfully, but these errors were encountered: