All notable changes to spaceonfire/collection
will be documented in this file.
Updates should follow the Keep a CHANGELOG principles.
- Changes caused by minor updates in
spaceonfire/type
library.
- First release from monorepo.
- Support installation on PHP 8.
- Update
spaceonfire/type
library up to^1.2
. Replace deprecated staticTypeFactory
call inTypedCollection
.
- Development config updates
- Minor type issues fixes found by static analyser
- Make collection interface stricter
- Added abstract decorator
- Added
IndexedCollection
decorator TypedCollection
now acts as decorator
TypedCollection
now final. Extend it with a decorator.
BaseCollection
has been removed. Use decorators if you need to add new functionality to collections.
- Use
spaceonfire/type
for checking typed collection items type
- Fix division by zero when calling average() on empty collection
- Update
CollectionInterface
:- update method signatures according to
BaseCollection
- update phpDoc comments
- update method signatures according to
- Replace Closure with callable type
- Move collection aliases to trait
- Implement FilterableInterface from
spaceonfire/criteria
by collection
- Fixed
ArrayHelper::unflatten()
method.
- New methods added:
CollectionInterface::unique()
CollectionInterface::implode()
CollectionInterface::first()
CollectionInterface::last()
CollectionInterface::firstKey()
CollectionInterface::lastKey()
CollectionInterface::average()
CollectionInterface::median()
- Method aliases added:
BaseCollection::avg()
alias toBaseCollection::average()
BaseCollection::join()
alias toBaseCollection::implode()
- Declare
CollectionInterface::merge
attributes - Fix example in README.md
- Fix
BaseCollection::filter
call with empty callback
- Huge update for
TypedCollection
:- check type on item add to collection
- add
downgrade
method that returns simpleCollection
instance - override some methods witch logic requires downgrade, restore original
TypedCollection
when we can - cover
BaseCollection
andTypedCollection
with tests
- Fix checking class and interface existence in TypedCollection
- Add TypedCollection
- Documentation generated
- Base collection implementation