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
if (method_exists($this->propertyTypeExtractor, 'getType') && !$this->typeResolver) {
39
+
throw new \LogicException('Symfony TypeInfo is required to use LiveProps. Try running "composer require symfony/type-info".');
40
+
}
37
41
}
38
42
39
43
public function getMetadata(string $name): LiveComponentMetadata
@@ -77,13 +81,13 @@ public function createPropMetadatas(\ReflectionClass $class): array
77
81
78
82
public function createLivePropMetadata(string $className, string $propertyName, \ReflectionProperty $property, LiveProp $liveProp): LivePropMetadata|LegacyLivePropMetadata
79
83
{
84
+
$reflectionType = $property->getType();
85
+
if ($reflectionType instanceof \ReflectionUnionType || $reflectionType instanceof \ReflectionIntersectionType) {
86
+
throw new \LogicException(\sprintf('Union or intersection types are not supported for LiveProps. You may want to change the type of property %s in %s.', $property->getName(), $property->getDeclaringClass()->getName()));
87
+
}
88
+
80
89
// BC layer when "symfony/type-info" is not available
81
90
if (!method_exists($this->propertyTypeExtractor, 'getType')) {
82
-
$type = $property->getType();
83
-
if ($type instanceof \ReflectionUnionType || $type instanceof \ReflectionIntersectionType) {
84
-
throw new \LogicException(\sprintf('Union or intersection types are not supported for LiveProps. You may want to change the type of property %s in %s.', $property->getName(), $property->getDeclaringClass()->getName()));
throw new \LogicException(\sprintf('Union or intersection types are not supported for LiveProps. You may want to change the type of property "%s" in "%s".', $propertyName, $className));
0 commit comments