1.4 KiB
1.4 KiB
Changelog
1.0.0
Breaking
- PHP 8.2 or newer is required.
- Contributors need PHPUnit 11 to run the test suite.
Added
compile()andCompilable: partials, curried and fixed functions, pipes and predicates flatten into plain closures once, so hot loops don't go through their__invoke(). Compiled internal functions drop extra arguments.- Collections in
Kadet\Functional\Collections: transforms (map, filter and friends), queries, and collectors with grouping. The transforms also come lazy, returning generators, inKadet\Functional\Collections\Lazy; queries and collectors accept lazy input and end a lazy chain. - Collection callbacks get
($value, $key), except internal functions and callables declaring one parameter, which get only the value. Wrappers (partial(),memoize(), predicates,pipe()) are seen through to the function they call. php-dsis suggested for the collections.DsUnavailableExceptionis thrown when it is needed but not installed.EmptyCollectionExceptionis thrown by queries that need an element when the collection has none (or none matching).- Docblock types and generics, so static analysis understands collection contents.
Fixed
not()andPredicate::not()predicates return the negated predicate fromgetDecorated()instead of null.closure()andref()accept static method callables like[Foo::class, 'method'].