Replies: 1 comment 2 replies
-
Hi @dantleech, nice to see you're trying to integrate Valinor with Messenger. If you succeed, do you think it would be possible for you to integrate your development in https://github.com/CuyZ/Valinor-Bundle? Concerning your request, the library is currently not capable of detecting the generics of an object. It would require more runtime processing (which can quickly become heavy when working with heavy iterables/objects), and the API of the library would need a certain amount of work to be able to understand that, take for instance: /**
* @template T of object
*/
final class SomeClass
{
/** @var class-string<T> */
public string $name;
// …
} The system should be smart enough to infer Any thoughts on this? I'm not against trying to implement it, but this might be quite big. |
Beta Was this translation helpful? Give feedback.
-
Hi!
We are experimenting with using Valinor as a serializer for Symofny Messenger in order to save messages in JSON.
The tricky part is storing the type in the
Envelope
header. The Symfony Serializer just does$object::class
... but for Valinor our type isClass1<Class2>
.Do you think it feasible to introduce a way to generate the string type for a concrete object?
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions