All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- Added support for PHP 8.0+. From now PHP >= 7.3 is supported.
- Dropped support for PHP < 7.3.
Enumerabledoes not satisfy to the interfaceLitGroup\Equatableanymore.- Method
equals()now throws anInvalidArgumentExceptionwhen a given argument is of a different type.
- From now
EnumerableimplementsEquatableinterface from packagelitgroup/equatable.
- (BC Break) Requires PHP >=7.0
Enumerable::getRawValue()which replacesEnumerable::getIndex().EnumerableTestCase::assertEnumHasRawValue()andEnumerableTestCase::assertEnumHasRawValues().
EnumerableTestCase::assertEnumValuesCount()isstaticfrom now.
Enumerable::getIndex(). UseEnumerable::getRawValue()instead.EnumerableTestCase::assertEnumIndex(). UseEnumerableTestCase::assertEnumHasRawValue()instead.EnumerableTestCase::assertEnumIndexs(). UseEnumerableTestCase::assertEnumHasRawValues()instead.
- Bug #11. Now Enumerable will throw a
LogicExceptionif factory method of enumerable returns scalar value.
- EnumerableTestCase::assertEnumIndexes() now checks, that tested enumerable class contains amount of values equal to amount of values in the payload of the assertion.
Enumerablecan check type of enumerable value in some cases.
- Abstract test case for enumerable values
LitGroup\Enumerable\Test\EnumerableTestCase.
Enumerable::getValue()was removed. UseEnumerable::getValueOf()instead.
Enumerable::getValueOf()which returns value by index. (Replaces deprecatedgetValue()).- Checking of duplication of indexes.
- Added validation of type of index. Index can be
stringorint.
Enumerablenow throws\LogicExceptioninstead of\DomainExceptionon initialization failure.
Enumerable::getValue()will be removed since v0.4.0. UsegetValueOf()instead.
- (BC Break)
Enumerablecannot be serialized anymore. - Now enumerable types works as runtime constants and can be correctly
checked on identity with operator
===.
- Basic implementation for
Enumerable.