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.
Enumerable
does not satisfy to the interfaceLitGroup\Equatable
anymore.- Method
equals()
now throws anInvalidArgumentException
when a given argument is of a different type.
- From now
Enumerable
implementsEquatable
interface from packagelitgroup/equatable
.
- (BC Break) Requires PHP >=7.0
Enumerable::getRawValue()
which replacesEnumerable::getIndex()
.EnumerableTestCase::assertEnumHasRawValue()
andEnumerableTestCase::assertEnumHasRawValues()
.
EnumerableTestCase::assertEnumValuesCount()
isstatic
from now.
Enumerable::getIndex()
. UseEnumerable::getRawValue()
instead.EnumerableTestCase::assertEnumIndex()
. UseEnumerableTestCase::assertEnumHasRawValue()
instead.EnumerableTestCase::assertEnumIndexs()
. UseEnumerableTestCase::assertEnumHasRawValues()
instead.
- Bug #11. Now Enumerable will throw a
LogicException
if 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.
Enumerable
can 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
string
orint
.
Enumerable
now throws\LogicException
instead of\DomainException
on initialization failure.
Enumerable::getValue()
will be removed since v0.4.0. UsegetValueOf()
instead.
- (BC Break)
Enumerable
cannot be serialized anymore. - Now enumerable types works as runtime constants and can be correctly
checked on identity with operator
===
.
- Basic implementation for
Enumerable
.