Releases: markrogoyski/itertools-php
Releases Β· markrogoyski/itertools-php
Release list
v2.4.0
New Features
- Infinite
generate
- Random
sample
- Reduce
consumetoLastMatchtoLastMatchIndextoLastMatchKeytoOnly
- Set
duplicatesduplicatesBy
- Single
groupAdjacentBypadLeftpadRightsplitWhen
- Sort
shuffle
- Summary
atLeastNatMostNendsWithendsWithCoercivestartsWithstartsWithCoercive
- Stream
appendatLeastNatMostNconsumeduplicatesduplicatesByendsWithendsWithCoercivegroupAdjacentBypadLeftpadRightprependsampleshufflesplitWhenstartsWithstartsWithCoercivetoLastMatchtoLastMatchIndextoLastMatchKeytoOnly
Bug Fixes
- Coercive comparisons now collapse all numeric forms loose-equal to 0 or 1 (e.g.
1vs'1.0','01','1e0';0vs'0.0',-0.0,'-0') consistently with PHP's==semantics. Affects every coercive API inSummary,Set,Math, andStream.
v2.3.0
New Features
- Combinatorics
powerset
- Infinite
iterate
- Multi
roundRobinunzip
- Reduce
toFirstMatchIndextoFirstMatchKey
- Set
distinctAdjacentdistinctAdjacentBy
- Single
interspersemapSpread
- Sort
sortByasortBylargestsmallest
- Stream
asortBydistinctAdjacentdistinctAdjacentByintersperselargestmapSpreadpowersetroundRobinWithsmallestsortBytoFirstMatchIndextoFirstMatchKeyunzip
Improvements
- Reorganized translated docs
v2.2.0
New Features
- Combinatorics (new)
productpermutationscombinationscombinationsWithReplacement
- Summary
containscontainsCoercive
- Reduce
toFirstMatch
- Single
enumerateaccumulate
- Transform
partition
- Stream
accumulatecombinationscombinationsWithReplacementcontainscontainsCoerciveenumeratepermutationsproductWithtoFirstMatchtoPartitionzipzipLongestzipFilledzipEqual
Improvements
- Fix NaN handling in
Math::runningMaxandMath::runningMinto preserve monotonicity (skip NaN values and carry forward accumulator; yield NaN when no prior value exists) - Fix
Random::percentageto 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
Improvements
- Fix
cyclecrash with generator-returning IteratorAggregate and null handling in min/max reductions - Fix
allMatch/anyMatch/noneMatchto use boolean coercion instead of strict comparison - Fix
Sort::sortdropping elements when iterable has duplicate keys - Fix
Sort::asortdropping elements when iterable has duplicate keys - Fix
Summary::isEmptyto rewind non-Generator iterators before checking. - Fix NaN handling in
Summary::isSortedandisReversed - Skip NaN values in
Reduce::toMin/toMax/toMinMaxto 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
Breaking Changes
- Minimum PHP version updated from 7.4 to 8.2
- Updated PHPUnit from ^9.0 to ^10.0
New Features
- Set
differencedifferenceCoercive
- Stream
differenceWithdifferenceCoerciveWith
Improvements
- Added native
mixedand 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
Improvements
- Improvements for PHP 8.4 compatibility
v1.8.0
New Features
- Set
distinctBy
- Stream
distinctBy
v1.7.0
New Features
- Math
frequenciesrelativeFrequencies
Improvements
- Internal improvements for static analysis
v1.6.0
New Features
- Multi
zipFilled
- Reduce
toNth
- Stream
toNthzipFilledWith
v1.5.0
New Features
- Reduce
toRandomValue
- Set
unionunionCoercive
- Single
skip
- Summary
allUniqueisEmpty
- Stream
- Stream Operations
skipunionWithunionCoerciveWith
- Debug Operations
peekpeekPrintpeekPrintRpeekStream
- Reduction Terminal Operations
toRandomValue
- Summary Terminal Operations
allUniqueisEmpty
- Stream Operations
Bug Fixes
Summary::allMatchnow returns true on empty iterables, as was documented.