Releases: marc-mabe/php-enum
v4.1.1
v4.1.0
v4.0.0
First stable release of new major version
We have worked a lot to make this library even more useful and also optimized the performance a lot!
To be able to do so we introduced a couple of BC breaks (please read the changes carefully) but we tried to keep them as small as possible.
Changes
-
Added Immutable
EnumSet
andEnumMap
API- Added
with*
methods which will not modify the current object but instead generate a new object - Now the iterable interface is using
IteratorAggregate
withGenerator
to move the iteration state into an own object and provides much better performance - The mutable API will stay untouched. This means that you have the choice to use either the mutable or immutable API depending on your use case.
- #109 #110 #118
- Added
-
Added methods to bulk modify an
EnumSet
andEnumMap
and to instantiate state- The constructor supports an
iterable
second argument to instantiate the state - Added methods
addIterable
,removeIterable
,withIterable
,withoutIterable
- The constructor supports an
-
Consistent Method Namings
- We have renamed the following methods to be consistent over all classes.
- The old method names are marked as deprecated and will trigger a deprecation notice in the last 4.x release and get removed in 5.x
EnumSet::attach
->EnumSet::add
EnumSet::detach
->EnumSet::remove
EnumSet::contains
->EnumSet::has
EnumMap::contains
->EnumMap::has
- #120 #121
-
Added Type-Hints
- All public methods have argument and return type-hints where possible.
-
PHP-7.1
- We have raised the required PHP version from 5.6 to 7.1 and removed HHVM support.
- This has been done to reduce internal complexity, to improve performance and to be able to define type-hints
BC-Breaks
-
As of moving from
Iterator
toIteratorAggregate
- removed methods - please use
foreach
directly or migrate togetIterator
insteadEnumSet::current
EnumSet::key
EnumSet::next
EnumSet::rewind
EnumSet::valid
EnumMap::current
EnumMap::key
EnumMap::next
EnumMap::rewind
EnumMap::valid
EnumMap::seek
- removed methods - please use
-
As of moving to
Genreator
- On iterating an
EnumSet
orEnumMap
the iterator position can move forward only Enum[Set|Map]->getIterator()->rewind()
throws an exception
- On iterating an
-
Soft Deprecations
EnumSet::attach
please useEnumSet::add
insteadEnumSet::detach
please useEnumSet::remove
insteadEnumSet::contains
please useEnumSet::has
insteadEnumMap::contains
please useEnumMap::has
instead
https://github.com/marc-mabe/php-enum/issues?utf8=%E2%9C%93&q=is%3Aclosed+milestone%3A4.0.0
v4.0.0-rc1
First Release Candidate of new major version
We have worked a lot to make this library even more useful and also optimized the performance a lot!
To be able to do so we introduced a couple of BC breaks (please read the changes carefully) but we tried to keep them as small as possible.
Changes
-
Added Immutable
EnumSet
andEnumMap
API- Added
with*
methods which will not modify the current object but instead generate a new object - Now the iterable interface is using
IteratorAggregate
withGenerator
to move the iteration state into an own object and provides much better performance - The mutable API will stay untouched. This means that you have the choice to use either the mutable or immutable API depending on your use case.
- #109 #110 #118
- Added
-
Added methods to bulk modify an
EnumSet
andEnumMap
and to instantiate state- The constructor supports an
iterable
second argument to instantiate the state - Added methods
addIterable
,removeIterable
,withIterable
,withoutIterable
- The constructor supports an
-
Consistent Method Namings
- We have renamed the following methods to be consistent over all classes.
- The old method names are marked as deprecated and will trigger a deprecation notice in the last 4.x release and get removed in 5.x
EnumSet::attach
->EnumSet::add
EnumSet::detach
->EnumSet::remove
EnumSet::contains
->EnumSet::has
EnumMap::contains
->EnumMap::has
- #120 #121
-
Added Type-Hints
-
All public methods have argument and return type-hints where possible.
-
PHP-7.1
- We have raised the require PHP version from 5.6 to 7.1 and removed HHVM support.
- This has been done to reduce internal complexity, to improve performance and to be able to define type-hints
BC-Breaks
-
As of moving from
Iterator
toIteratorAggregate
- removed methods - please use
foreach
directly or migrate togetIterator
insteadEnumSet::current
EnumSet::key
EnumSet::next
EnumSet::rewind
EnumSet::valid
EnumMap::current
EnumMap::key
EnumMap::next
EnumMap::rewind
EnumMap::valid
EnumMap::seek
- removed methods - please use
-
As of moving to
Genreator
- On iterating an
EnumSet
orEnumMap
the iterator position can move forward only Enum[Set|Map]->getIterator()->rewind()
throws an exception
- On iterating an
-
Soft Deprecations
EnumSet::attach
please useEnumSet::add
insteadEnumSet::detach
please useEnumSet::remove
insteadEnumSet::contains
please useEnumSet::has
insteadEnumMap::contains
please useEnumMap::has
instead
https://github.com/marc-mabe/php-enum/issues?utf8=%E2%9C%93&q=is%3Aclosed+milestone%3A4.0.0