- Issue created by @mxh
- First commit to issue fork.
- 🇬🇧United Kingdom jonathanshaw Stroud, UK
Agreed. Php only requires \Traversable to be returned by \Iterable::getIterator, it doesn't need to be \ArrayIterator.
It looks like this was given \ArrayIterator in 📌 Fix root namespace classes DebugClassLoader forward compatibility warnings Needs work , as part of a project to clean up a whole set of unrelated type hints. There was no discussion of the specific needs of plugin lazy loading.
In fact, we should update the provided implementation to use a generator. It's clearly in line with the whole purpose of LazyPluginCollection to do so.
- Merge request !11886Use \Traversable and a generator in LazyPluginCollection::getIterator() → (Open) created by jonathanshaw
- 🇬🇧United Kingdom jonathanshaw Stroud, UK
What I'm not sure about is whether changing this will reintroduce the bug found in #2431379: LazyPluginCollection should not implement \Iterator → .
- 🇩🇪Germany mxh Offenburg
Thank you for addressing this issue. I came to the same findings as you mentioned in #4 that this was changed as a part of a major refactoring without considering the consequences of this new explicit return type.
So let's change the return type here, but not the implementation.
Yes, that's totally sufficient for being able to implement a "real lazy" plugin collection.
- 🇬🇧United Kingdom jonathanshaw Stroud, UK
Anyone interested in this issue likely also interested in 📌 DefaultLazyPluginCollection unnecessarily instantiates plugins when sorting collection Active .