The return value from the input factory was not checked when the Collection is created from a callable.
As only arrays and Traversables are valid return types, this should be checked.
Also IteratorAggregate::getIterator() must return a Traversable so we need to wrap the return value of the input factory in an ArrayIterator in case it is an array.
The return value from the input factory was not checked when the Collection is created from a callable. As only arrays and Traversables are valid return types, this should be checked.
Also
IteratorAggregate::getIterator()
must return aTraversable
so we need to wrap the return value of the input factory in anArrayIterator
in case it is an array.