All Versions
9
Latest Version
Avg Release Cycle
306 days
Latest Release
397 days ago

Changelog History

  • v2.1.0 Changes

    September 19, 2020
    • โž• Added iter\slice() method (#80). This works like explode() but produces an iterator.
    • โž• Added iter\mapWithKeys() method (#81). This works like iter\map() but also passes keys as second parameter to the callable.
  • v2.0.0 Changes

    May 30, 2019

    ๐Ÿš€ This release makes iter compatible with PHP 7.4 by renaming the iter\fn namespace to iter\func.

    • PHP >= 7.1 is now required. Functions are annotated with iterable types. (#52)
    • The iter\fn namespace has been renamed to iter\func. This is necessary for PHP 7.4 compatibility. (#79)
    • 0๏ธโƒฃ Default $preserveKeys = false in chunk() and add chunkWithKeys() function.
    • Avoid advancing by one additional iteration in slice(). (#75)
  • v1.6.0 Changes

    November 10, 2017
    • โž• Added iter\enumerate() function (#43).
    • โž• Added iter\isEmpty() function (#46).
    • โž• Added $preserveKeys parameter to iter\chunk() (#42).
  • v1.5.0 Changes

    April 26, 2017
    • โž• Added $levels argument for flatten().
    • โž• Added flatMap() function.
  • v1.4.0 Changes

    September 27, 2016
    • ๐Ÿ›  Fixed infinite loop when iter\zip() is called without arguments.
    • โž• Added additional error checks for various "length" and "count" parameters (usually disallowing negative numbers).
    • The iter\flatten() function now preserves keys.
    • โž• Added an iter\recurse() function. Example use is iter\recurse('iter\toArray', $data) which will recursively convert an iterator to array.
  • v1.3.0 Changes

    October 21, 2015
    • โž• Added Iterator iter\product(...$iterables):
      Returns the cartesian product iterator of the passed iterators. (#25)
    • โž• Added bool iter\isIterable(mixed $value):
      Returns whether the value is an array or Traversable.
    • โž• Added $key parameter to the callback of reduce() and reductions(). (#28)
    • โž• Added support for <=> to fn\operator(). It is also supported on PHP versions that do not natively provide a <=> operator.
    • All functions now validate that inputs are iterables.
  • v1.2.0 Changes

    March 08, 2015
    • โž• Added new iter functions:
      • mixed search(callable $predicate, iterable $iterable):
        Returns the first value from $iterable which satisfies $predicate, or null if no such element exists.
      • Iterator reductions(callable $function, iterable $iterable, mixed $startValue = null):
        Returns an iterator which contains the intermediate values produced by applying a reduction function to an iterator. Can for example be used to compute cumulative sums.
    • ๐Ÿ‘ Added support for the power operator (**) to iter\fn\operator(). Support is available also on older PHP versions which do not have an actual ** operator.
  • v1.1.0 Changes

    March 27, 2014

    โž• Added iter functions:

    • Iterator mapKeys(callable $function, iterable $iterable)
    • Iterator reindex(callable $function, iterable $iterable)
    • Iterator chunk(iterable $iterable, int $size)
    • Iterator flip(iterable $iterable)
    • string join(string $separator, iterable $iterable)

    โž• Added iter\fn functions:

    • function nested_index(...$indices)
  • v1.0.0 Changes

    January 07, 2014

    ๐Ÿš€ First release :)