Skip to content

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

@rotexdegba

Description

@rotexdegba

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

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions