Download the PHP package gielfeldt/iterators without Composer
On this page you can find all versions of the php package gielfeldt/iterators. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gielfeldt/iterators
More information about gielfeldt/iterators
Files in gielfeldt/iterators
Package iterators
Short Description Various iterators.
License MIT
Homepage https://github.com/gielfeldt/iterators
Informations about the package iterators
Iterators
Installation
Iterators
This library contains a bunch of various iterators that I made primarily for getting more acquainted with iterators in PHP. Some may be useful. Some may be silly.
Enjoy!
CachingIterator
ChecksumIterator
ChunkIterator
CloningIterator
CombineIterator
CountableIterator
DiffIterator
FiniteIterator
FlipIterator
GlobIterator
IndexIterator
InfiniteIterator
InterleaveIterator
IntersectIterator
TraversableIterator
KeysIterator
MapIterator
RandomIterator
RepeatIterator
ReplaceableIterator
ReservoirSamplingIterator
ShuffleIterator
SortIterator
StepIterator
UniqueIterator
ValuesIterator
CachingIterator
Cache an iterator for multiple iterations.
Output:
ChecksumIterator
Generate a checksum for an iterator, either per iteration or the entire dataset.
Output:
ChunkIterator
Split an iterator into chunks of iterators.
CloningIterator
Clone each value in iteration.
Output:
CombineIterator
Similar to array_combine(). However, iterators can have non-unique keys. Be aware of this when using iterator_to_array();
Output:
CountableIterator
Takes any iterator and makes it countable, simply by iterating through it and counting.
Output:
DiffIterator
Compares two iterators. Similar to array_diff(). Possible to set a custom compare function.
Output:
FiniteIterator
Provide an end condition through an anonymous function for an iterator.
Output:
FlipIterator
Similar to array_flip(). However, iterators can have non-unique keys. Be aware of this when using iterator_to_array();
Output:
GlobIterator
Similar to \GlobIterator, but supports **
Output:
IndexIterator
Iterate only through certain rows of an iterator.
Output:
InfiniteIterator
Like SPL's InfiniteIterator but provides an additional method, getCurrentIteration().
Output:
InterleaveIterator
Interleave multiple iterators.
Output:
IntersectIterator
Similar to array_intersect(). Possible to set a custom compare function.
Output:
TraversableIterator
Like SPL's IteratorIterator, but with a more meaningful name :-) and provides a getIndex() method.
Output:
KeysIterator
Similar to array_keys().
Output:
MapIterator
Similar to array_map().
Output:
RandomIterator
Selects a set of random elements from a traversable. Does not work with iterators that can only be traversed once. For that, see the ReservoirSamplingIterator.
Output:
RepeatIterator
Repeat and iterator n times.
Output:
ReplaceableIterator
Just like TraversableIterator but with a setInnerIterator() method.
Output:
ReservoirSamplingIterator
Like RandomIterator but works more effeciently on iterators of unknown size or which can be traversed only once.
Output:
ShuffleIterator
Iterate randomly over a traversable.
Output:
SortIterator
Output:
StepIterator
Iterate over a traversable in steps.
Output:
UniqueIterator
Similar to array_unique(). Also supports a custom callback function.
Output:
ValuesIterator
Similar to array_vales().
Output:
Not iterators as such ...
These are more an extension of the SPL file handling.
CsvFileObject
AtomicTempFileObject
AtomicTempFileObjects
CsvFileObject
An extension of SplFileObject in csv mode, but with csv header support.
Output:
AtomicTempFileObject
AtomicTempFileObjects
Helpers
Contains various helper methods.
Iterator
Output:
Caveats
- Lots probably.