Open
Description
I'm using php-ds. But it seems to be highly unsupported by symfony ux. It's really complicated to have something working with. But here is something that looks more like an error to me than something unsupported. Issues with Doctrine collections may be connected.
Here is an example of a component:
class Options
{
// a vector because they are ordered, it avoids storing the order elsewhere or weird array manipulation
Opt
/** @var Vector<Option> */
#[LiveProp(useSerializerForHydration: true, serializationContext: ['groups' => self::SERIALIZATION_GROUP])]
public Vector $selectedOptions;
}
Looks ok isn't it? Yep, but it does not work. Because the LiveComponentHydrator
transforms the type Vector
to Option[]
, you guess the rest: it results in an array, an array is not a Vector, so it fails.
Here is the location of the error:
ux/src/LiveComponent/src/LiveComponentHydrator.php
Lines 268 to 272 in 6b8b305
Not sure how you want to fix this, it looks not easy.