-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Sweep through the package and look into type hinting on the iterable pseudo-type instead of array, this would allow users of this package to be able to use arrays or instances of \Traversable in those scenarios. For example makeNew(array $items=[], bool $preserve_keys=true) will now become makeNew(iterable $items=[], bool $preserve_keys=true), thereby allowing users of this package to be able to create collections from iterables like Iterators, Generators, instances of ArrayObject etc.
https://www.php.net/manual/en/language.types.iterable.php
https://www.php.net/manual/en/function.iterator-to-array.php
Look at using libraries like:
and search here: https://packagist.org/?query=iterable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request