dhii / iterator-helper-base
Common functionality for working with iterables
Installs: 10 926
Dependents: 11
Suggesters: 1
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 2
Requires
- php: ^5.4 | ^7.0
- dhii/exception: ^0.1-alpha4
Requires (Dev)
- codeclimate/php-test-reporter: <=0.3.2
- dhii/invocable-interface: 0.1-alpha1
- dhii/php-cs-fixer-config: ^0.1
- dhii/stringable-interface: ^0.1
- phpunit/phpunit: ^4.8
- ptrofimov/xpmock: dev-master
Suggests
- dhii/callback-abstract: For structural invocation of callables
This package is auto-updated.
Last update: 2024-11-07 03:29:17 UTC
README
Common functionality for working with iterables.
Traits
ResolveIteratorCapableTrait
- Retrieves the deepest iterator within a depth limit in an iterator hierarchy, where every parent is anIteratorAggregate
. Can use a complex test to look for things that are not only iterators. Detects some signs of infinite recursion.CountIterableCapableTrait
- Counts elements in an iterable which passes normalization byNormalizeIterableCapableTrait
. Uses the most optimal method for retrieving the count.NormalizeIteratorCapableTrait
- Normalizes any iterable that passes normalization byNormalizeIterableCapableTrait
into an instance ofIterator
.MapIterableCapableTrait
- Maps an iterable, similarly toarray_map()
oriterator_apply()
.