Releases: spatie/enum
Releases · spatie/enum
2.3.2
2.3.1
2.3.0
2.2.0
2.1.2
2.1.1
2.1.0
2.0.1
2.0.0
A full major rework of the Enum
class - we try to list all changes, for more details you can check out the PR and the Issue.
- Add
\Spatie\Enum\Enumerable
interface - Add
\Spatie\Enum\Exceptions\DuplicatedIndexException
,\Spatie\Enum\Exceptions\DuplicatedValueException
,\Spatie\Enum\Exceptions\InvalidIndexException
and\Spatie\Enum\Exceptions\InvalidValueException
exceptions - Add
\Spatie\Enum\Enum->getIndex()
method - Add
\Spatie\Enum\Enum::getIndices()
method - Add
\Spatie\Enum\Enum->getValue()
method - Add
\Spatie\Enum\Enum::getValues()
method - Rename
\Spatie\Enum\Enum::from()
to\Spatie\Enum\Enum::make()
- Rename
\Spatie\Enum\Enum::equals()
to\Spatie\Enum\Enum::isEqual()
- Rename
\Spatie\Enum\Enum::isOneOf()
to\Spatie\Enum\Enum::isAny()
- Update all methods have strict type checks:
index: int
andvalue: string
- Update all methods are compatible with all required types: index, value, name or instance of Enum
- Update
\Spatie\Enum\Enum->__construct()
signature and responsibility - only take index & value and validate them - Drop recursive
\Spatie\Enum\Enum::make()
support from inside of an unstatic method - Drop
\Spatie\Enum\Enum::$map
in favor of\Spatie\Enum\Enum->getIndex()
and\Spatie\Enum\Enum->getValue()
2.0.0-dev.1
first dev release of #18