-
-
Notifications
You must be signed in to change notification settings - Fork 586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for iterable #1094
Comments
I think here my answer is the same as for the |
I was thinking that since we're working with interface the implementation shouldn't matter (if end user respect the type ofc). The issue is that currently it's not possible to have: /**
* @Serializer\Type("Generator<T>")
* @var iterable<T>
*/
private $collection;
|
how to deserialize Do you want to say that using |
Yes exactly. I don't see any better way when working with interfaces. But consumer should not care about implementation when expecting interface. 🤔 |
You convinced me. With this in mind, then |
Will look into it, thanks! You can assign me to this issue. |
Here #1023 the generators and iterators support was implemented. I wonder would it be possible to support
iterable
?Currently, I have to type against concrete type, eg.
* @Serializer\Type("array<T>")
* @Serializer\Type("Generator<T>")
I'd like to type as
* @Serializer\Type("iterable<T>")
. I suppose it could be deserialized eg. as an array when deserializing.Would it make sense?
The text was updated successfully, but these errors were encountered: