Skip to content

Releases: markrogoyski/itertools-php

v2.4.0

Choose a tag to compare

@markrogoyski markrogoyski released this 07 May 05:10

New Features

  • Infinite
    • generate
  • Random
    • sample
  • Reduce
    • consume
    • toLastMatch
    • toLastMatchIndex
    • toLastMatchKey
    • toOnly
  • Set
    • duplicates
    • duplicatesBy
  • Single
    • groupAdjacentBy
    • padLeft
    • padRight
    • splitWhen
  • Sort
    • shuffle
  • Summary
    • atLeastN
    • atMostN
    • endsWith
    • endsWithCoercive
    • startsWith
    • startsWithCoercive
  • Stream
    • append
    • atLeastN
    • atMostN
    • consume
    • duplicates
    • duplicatesBy
    • endsWith
    • endsWithCoercive
    • groupAdjacentBy
    • padLeft
    • padRight
    • prepend
    • sample
    • shuffle
    • splitWhen
    • startsWith
    • startsWithCoercive
    • toLastMatch
    • toLastMatchIndex
    • toLastMatchKey
    • toOnly

Bug Fixes

  • Coercive comparisons now collapse all numeric forms loose-equal to 0 or 1 (e.g. 1 vs '1.0', '01', '1e0'; 0 vs '0.0', -0.0, '-0') consistently with PHP's == semantics. Affects every coercive API in Summary, Set, Math, and Stream.

v2.3.0

Choose a tag to compare

@markrogoyski markrogoyski released this 02 May 16:57

New Features

  • Combinatorics
    • powerset
  • Infinite
    • iterate
  • Multi
    • roundRobin
    • unzip
  • Reduce
    • toFirstMatchIndex
    • toFirstMatchKey
  • Set
    • distinctAdjacent
    • distinctAdjacentBy
  • Single
    • intersperse
    • mapSpread
  • Sort
    • sortBy
    • asortBy
    • largest
    • smallest
  • Stream
    • asortBy
    • distinctAdjacent
    • distinctAdjacentBy
    • intersperse
    • largest
    • mapSpread
    • powerset
    • roundRobinWith
    • smallest
    • sortBy
    • toFirstMatchIndex
    • toFirstMatchKey
    • unzip

Improvements

  • Reorganized translated docs

v2.2.0

Choose a tag to compare

@markrogoyski markrogoyski released this 19 Apr 20:59

New Features

  • Combinatorics (new)
    • product
    • permutations
    • combinations
    • combinationsWithReplacement
  • Summary
    • contains
    • containsCoercive
  • Reduce
    • toFirstMatch
  • Single
    • enumerate
    • accumulate
  • Transform
    • partition
  • Stream
    • accumulate
    • combinations
    • combinationsWithReplacement
    • contains
    • containsCoercive
    • enumerate
    • permutations
    • productWith
    • toFirstMatch
    • toPartition
    • zip
    • zipLongest
    • zipFilled
    • zipEqual

Improvements

  • Fix NaN handling in Math::runningMax and Math::runningMin to preserve monotonicity (skip NaN values and carry forward accumulator; yield NaN when no prior value exists)
  • Fix Random::percentage to always yield float (previously yielded int(0) when underlying RNG returned 0)
  • Upgrade Psalm from v6 to v7 for PHP 8.5 compatibility

v2.1.0

Choose a tag to compare

@markrogoyski markrogoyski released this 29 Mar 20:51

Improvements

  • Fix cycle crash with generator-returning IteratorAggregate and null handling in min/max reductions
  • Fix allMatch/anyMatch/noneMatch to use boolean coercion instead of strict comparison
  • Fix Sort::sort dropping elements when iterable has duplicate keys
  • Fix Sort::asort dropping elements when iterable has duplicate keys
  • Fix Summary::isEmpty to rewind non-Generator iterators before checking.
  • Fix NaN handling in Summary::isSorted and isReversed
  • Skip NaN values in Reduce::toMin/toMax/toMinMax to prevent incorrect results
  • Throw InvalidArgumentException for non-serializable objects in coercive comparison mode
  • Throw InvalidArgumentException for non-positive count in Transform::tee
  • Throw InvalidArgumentException for step=0 in Infinite::count
  • Throw InvalidArgumentException for negative position in Reduce::toNth
  • Throw InvalidArgumentException for negative overlap in Single::chunkwiseOverlap

v2.0.0

Choose a tag to compare

@markrogoyski markrogoyski released this 07 Mar 19:56

Breaking Changes

  • Minimum PHP version updated from 7.4 to 8.2
  • Updated PHPUnit from ^9.0 to ^10.0

New Features

  • Set
    • difference
    • differenceCoercive
  • Stream
    • differenceWith
    • differenceCoerciveWith

Improvements

  • Added native mixed and union type hints throughout the codebase
  • Removed #[\ReturnTypeWillChange] attributes (replaced with proper return types)
  • Updated CI to test PHP 8.2, 8.3, 8.4

v1.9.0

Choose a tag to compare

@markrogoyski markrogoyski released this 24 Feb 03:44

Improvements

  • Improvements for PHP 8.4 compatibility

v1.8.0

Choose a tag to compare

@markrogoyski markrogoyski released this 09 Sep 20:58

New Features

  • Set
    • distinctBy
  • Stream
    • distinctBy

v1.7.0

Choose a tag to compare

@markrogoyski markrogoyski released this 15 Jun 03:12

New Features

  • Math
    • frequencies
    • relativeFrequencies

Improvements

  • Internal improvements for static analysis

v1.6.0

Choose a tag to compare

@markrogoyski markrogoyski released this 16 Apr 16:28

New Features

  • Multi
    • zipFilled
  • Reduce
    • toNth
  • Stream
    • toNth
    • zipFilledWith

v1.5.0

Choose a tag to compare

@markrogoyski markrogoyski released this 19 Mar 18:27

New Features

  • Reduce
    • toRandomValue
  • Set
    • union
    • unionCoercive
  • Single
    • skip
  • Summary
    • allUnique
    • isEmpty
  • Stream
    • Stream Operations
      • skip
      • unionWith
      • unionCoerciveWith
    • Debug Operations
      • peek
      • peekPrint
      • peekPrintR
      • peekStream
    • Reduction Terminal Operations
      • toRandomValue
    • Summary Terminal Operations
      • allUnique
      • isEmpty

Bug Fixes

  • Summary::allMatch now returns true on empty iterables, as was documented.