-
Made compatible with XP 12 - @thekid
-
Added PHP 8.3 and 8.4 to the test matrix - @thekid
- Merged PR #57: Retrieve collection parts - @thekid
- Merged PR #55: Migrate test suite - @thekid
- Introduce dedicated
util.data.NoSuchElement
exception. It's thrown fromOptional::get()
if no element is present instead of the genericutil.NoSuchElementException
. For BC reasons, it extends the latter. (@thekid) - Implemented PR #54: Implement
Sequence::single()
- which is similar tofirst()
but raises an exception if there are more than 1 element in the sequence. (@thekid)
- Implemented xp-framework/rfc#341, dropping compatibility with XP 9 (@thekid)
- Merged PR #53: Implement
Sequence::zip()
intermediate operation (@thekid)
- Merged PR #52: Allow NULL for Sequence methods peek(), map(), filter(), skip(), limit() as well as Optional methods map() and filter() (@thekid)
- Fixed PHP 8.1 compatibility for
Traversable
subtypes - @thekid
- Added compatibility with
xp-framework/collections
version 10.0.0 (@thekid)
- Simplified test code, making use of anonymous classes, the RuntimeVersion
action and
Assert::throws()
, see pull request #50 (@thekid)
- Implemented xp-framework/rfc#334: Drop PHP 5.6. The minimum required PHP version is now 7.0.0! (@thekid)
- Made compatible with XP 10 - @thekid
- Added PHP 7.4 compatibility - @thekid
- Increased test coverage to 100% - @thekid
- Fixed PHP 7.2 compatibility - @thekid
- Fixed
each()
andpeek()
not being able to work with functions withvoid
return type. (@thekid)
- Merged PR #45: Forward compatibility with XP 9.0.0 - @thekid
- Refactored code to use dedicated fixture methods instead of using
xp
class methods typeOf() and gc(), see xp-framework/rfc#323 (@thekid)
- Merged PR #43 ("Remove deprecated functionality"):
. Removed
Sequence::concat()
method deprecated in favor of a multi- argument version ofSequence::of()
- see 6.4.2-RELEASE . Removed deprecated classes from yield refactoring released in 6.4.1 (@thekid)
- Added support for closures returning iterables in
Enumeration::of()
(@thekid)
- Improved
each()
performance when passing extra arguments - @thekid
- Merged PR #36: Add optional mapper to toArray() and toMap() - @thekid
- Merged PR #42: Deprecate static concat() in favor of multiple-argument
of()
. Also deprecatesutil.data.Iterators
class. (@thekid)
- Merged PR #41: Inline collecting() and counting(). Both methods are now four times faster. (@thekid)
- Heads up: Deprecated the following classes which were inlined: . AbstractMapper, Mapper, MapperWithKey . AbstractWindow, Window, WindowWithKey . AbstractFilterable, Filterable, FilterableWithKey . Flattener . Generator These will be removed in the next major release! (@thekid)
- Merged PR #40: Inline Generator class. Improves performance of the
creation methods
generate()
anditerate()
roughly three times. (@thekid) - Merged PR #39: Inline intermediate operations using
yield
. This brings a performance improvement forfilter()
,map()
,peek()
,flatten()
,skip()
andlimit()
with factors ranging from 4.1 up until 8.7 for the default cases; and double performance for bothskip()
andlimit()
with integer limits. (@thekid)
- Merged PR #35: Add
util.data.CannotReset
exception class replacing lang.IllegalStateException for indicating a sequence can't be processed more than once. This makes it easier to distinguish exception causes and handle them separately if necessary. (@thekid)
- Merged PR #34: Add ability to use yield statements inside flatten() (@thekid)
- Fixed issue with
limit()
closure being invoked with NULL when the end of the sequence is reached. (@thekid)
- Merged PR #33: Add optional "function" parameter to distinct() - @thekid
- Added forward compatibility with XP 8.0.0 - @thekid
- Merged PR #32: Drop PHP 5.5 support, use native varargs & unpacking (@thekid)
- Merged PR #31: Add optional filter to first() operation - @thekid
- Merged PR #29: Collection API - @thekid
- Added version compatibility with XP 7 - @thekid
- Fix code to use
nameof()
instead of the deprecatedgetClassName()
method from lang.Generic. See xp-framework/core#120 (@thekid)
- Added dependencies on collections and unittest libraries which have since been extracted from XP core. (@thekid)
- Merged PR #28: Fix Collectors class' methods to cast given functions (@thekid)
- Merged PR #27: Add support for optional mapper in toSet() and toList() (@thekid)
- Heads up: Dropped PHP 5.4 support. See pull request #26. Note: As the main source is not touched, unofficial PHP 5.4 support is still available though not tested with Travis-CI. (@thekid)
- Merged PR #25: Implement support for using keys in collect() - @thekid
- Merged PR #24: Implement support for mapping keys - @thekid
- Renamed whenNull() to
whenAbsent()
in util.data.Optional. This is more consistent with the present() method. See pull request #23 (@thekid) - Implemented Optional::toString(), equals() and hashCode() - @thekid
- Implemented Sequence::toString(), equals() and hashCode() - @thekid
- Fixed issue #22: tests not running on HHVM - @thekid
- Made Optional's constructor public and allow
new Optional(null)
to represent an optional with a present null value (@thekid) - Changed Optional::of() to return an empty optional if
null
is passed (@thekid) - Added whenNull() method to util.data.Optional to allow easy chaining (@thekid)
- Added filter(), map() and orUse() implementations to util.data.Optional See pull request #21 (@thekid)
- Don't keep index association when sorting, this yields arrays like
[1 => 'second', 0 => 'first']
. These arrays are not zero-based and considered maps e.g. by typeof() (@thekid)
- Heads up: Removed
sum()
operation, it can easily be rewritten to either$sum= $seq->reduce(0, function($a, $b) { return $a + $b; })
or$sum= $seq->collect(Collectors::summing())
which are more flexible. (@thekid) - Made functions to
Collectors::summing
andCollectors::averaging
optional. If omitted, the elements themselves will be used for the numbers. (@thekid) - Added support for referring to instance methods via string. Depends on xp-framework/core#44, see pull request #17 - @thekid
- Added
Sequence::toMap()
- see pull request #10 - @thekid - Added
Sequence::iterator()
- see pull request #16 - @thekid - Added the ability to pass a variable number of arguments to
Sequence::concat()
. At the same time, the method is changed to be more liberal in what it accepts. See pull request #13. (@thekid) - Implemented variant of
Sequence::each()
which iterates elements without callback and is thus more memory-efficient than calling e.g. toArray() and discarding the results. See pull request #12. (@thekid)
- Made
Sequence::of(null)
return an empty sequence - @thekid - Merged PR #5: Keys - @thekid
- Chose to make this 1.0.0 since it's been in productive use and thus well proven to work - @thekid
- Added support to omit value function in
Collectors::toMap()
. The collector then used the element itself as a value - @thekid
- Added experimental support to install via Composer - @thekid
- Merged PR #2: Make
skip()
andlimit()
also accept closures (@thekid)
- Added support for
util.Filter
class in XP Framework. See xp-framework/rfc#98 and xp-framework/rfc#266 (@thekid)
- Added support for PHP 5.5 generators (though minimum version requirement is still PHP 5.4) - @thekid
- Implemented
Sequence::flatten()
which treats each element as a sequence itself and returns each of its elements before continuing with the iterator's next element. (@thekid)
- Implemented
Sequence::sorted()
which supports closures, util.Comparator instances and sort flags as argument. (@thekid)
- Added
Sequence::$EMPTY
member - @thekid
- Implemented
Sequence::peek()
which additionally calls the given function for each element processed. Useful e.g. for debugging purposes. (@thekid)
- Changed
first()
method to return anOptional
instance - @thekid
- Exchange
Closure
type hints forcallable
. All methods now also accept strings pointing to functions, and array referring to class and instance methods. Solved internally by util.data.Closure utility class. (@thekid)
- Added support for
util.XPIterator
instances - @thekid
- Hello World! First release - @thekid