Skip to content

Commit fb80ce1

Browse files
committed
[LiveComponent] Fix BC Break
1 parent fc2b792 commit fb80ce1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/LiveComponent/src/Metadata/LiveComponentMetadataFactory.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
use Symfony\Component\PropertyInfo\PropertyTypeExtractorInterface;
1515
use Symfony\Component\PropertyInfo\Type as LegacyType;
16+
use Symfony\Component\TypeInfo\Exception\UnsupportedException;
1617
use Symfony\Component\TypeInfo\Type;
1718
use Symfony\Component\TypeInfo\Type\CollectionType;
1819
use Symfony\Component\TypeInfo\TypeResolver\TypeResolver;
@@ -130,8 +131,12 @@ public function createLivePropMetadata(string $className, string $propertyName,
130131
// Otherwise, we can use the TypeResolver to convert the ReflectionType to a Type
131132
$type = $this->typeResolver->resolve($reflectionType);
132133
} else {
133-
// If no type is available, we default to mixed
134-
$type = Type::mixed();
134+
try {
135+
$type = $this->typeResolver->resolve($property);
136+
} catch (UnsupportedException) {
137+
// If no type is available, we default to mixed
138+
$type = Type::mixed();
139+
}
135140
}
136141

137142
return new LivePropMetadata($property->getName(), $liveProp, $type);

0 commit comments

Comments
 (0)