Hello, I understand that at this time PSR-5 is lacking a sponsor, but I trust that it's ok for us to continue discussing ideas.
Out in the wild, I've seen two alternative approaches that can be applied at the class-level to apply typing to iterators.
However the problems with the above are, 1. __iterator() isn't a real (or magic) method, and 2. getIterator() actually returns an object of type Traversable or Iterator, and thus overriding these with another type is not strictly correct.
If I wish to propose an explicit syntax, is it ok for me to discuss it here, or should I open this on github? I could PR to the current PSR-5 if that's the best way to propose a change, maybe after a little bit of pre-discussion.
Thanks for hearing me out, and I hope I can actually start contributing to the group for once. :)
Kind regards,
Damian Mooyman | SilverStripe