1.6.0 (2024-04-24)
- Add T as a possible return type for lastOr and firstOr (b60ea9c)
1.5.0 (2024-01-08)
- add every, none and some functions to collection (cb1fe18)
- add first, firstOr, last, lastOr functions to collection (74ce180)
- add fromIterable function for Collection (1f7d851)
- add isEmpty and hasItems to collection (1d6b0b8)
1.5.0 (2024-01-05)
Added a couple of functions to the Collection class to enable a smoother developer experience when trying use it in a more functional style
The following functions were added:
fromIterable
- enables users of the collection to construction the collection from an iterable value like iterators, generators, etc.every
- Returns true if given callback returns truthy values for all itemsnone
- Returns true if given callback returns falsy values for all itemssome
- Returns true if given callback returns truthy values on some itemsfirst
- Get the first element of the collection that matches a callback, if given. Throws exception if collection is empty or predicate is never satisfiedfirstOr
- Same as first but returns $fallbackValue if collection is empty or predicate is never satisfiedlast
- Get the last element of the collection that matches a callback, if given. Throws exception if collection is empty or predicate is never satisfiedlastOr
- Same as last but returns $fallbackValue if collection is empty or predicate is never satisfiedisEmpty
- Returns whether the collection is emptyhasItems
- Returns whether the collection has items
1.4.0 (2023-12-19)
- annotate generic ArrayAccess implementation, fix generic IteratorAggregate implementation annotation (d654dbe)
1.3.1 (2023-12-05)
- phpdoc: let InMemoryRepository implement interface instead of extending it (ef575a5)
1.3.0 (2023-11-29)
- accept items in constructor arguments for in memory repository (687479e)
1.2.0 (2023-05-22)
- add generic/template support for queries/commands (5d2e689)
- add generic/template support for queries/commands (6d25a9c)
1.1.1 (2023-03-31)
1.1.0 (2023-01-20)
- Add
ChainRepository
to support multiple repositories. (87deb1d) - Add more functionality to
Collection
class (6e0c0a9) - Implement
ArrayAccess
for in-memory paginator. (6abd60e)
- Use
ForType
instead ofFor
for attributes (7dd103e)
1.0.2 (2023-01-16)
- Rename class to match PSR-4 autoloading standards. (6e8d82e)
1.0.1 (2023-01-16)
- Remove package from docstring. (a74b1ac)
1.0.0 (2023-01-16)
- Make
Collection
an instantiable class. - Change Repository interface.
- Use item and collection types as constructor arguments
- Update contracts for command and query bus.