Skip to content
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

Look into type hinting on the iterable pseudo-type instead of array #16

Open
rotexdegba opened this issue Nov 17, 2019 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@rotexdegba
Copy link
Member

rotexdegba commented Nov 17, 2019

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

@rotexdegba rotexdegba added the enhancement New feature or request label Nov 17, 2019
@rotexdegba
Copy link
Member Author

First commit: b9fce3b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant