Skip to content

Releases: spatie/enum

2.3.2

05 Sep 21:40
Compare
Choose a tag to compare
  • improve type hints

2.3.1

19 Aug 10:27
1b5c516
Compare
Choose a tag to compare
  • Fix protected method calls to allow overrides #37

2.3.0

05 Aug 16:23
802b8f6
Compare
Choose a tag to compare
  • Make \Spatie\Enum\Enumerable::isValidIndex/Name/Value() methods public #36

    Please note that this could be breaking for custom implementations of the \Spatie\Enum\Enumerable interface.

2.2.0

18 Jul 12:33
7c87c2f
Compare
Choose a tag to compare
  • Add \Spatie\Enum\Enum::getAll() method #33

2.1.2

07 May 09:10
9eac432
Compare
Choose a tag to compare
  • fix calling public non-static methods #32

2.1.1

18 Apr 08:32
93154c3
Compare
Choose a tag to compare
  • fix overriden existing public static methods like Enum::toArray() #29

2.1.0

17 Apr 09:25
b814025
Compare
Choose a tag to compare
  • add enum map index and value Enum::MAP_INDEX and Enum::MAP_VALUE #25

2.0.1

08 Apr 13:56
Compare
Choose a tag to compare
Improved static analysis support for `::make`

2.0.0

01 Apr 08:41
6a89b87
Compare
Choose a tag to compare

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 and value: 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

21 Mar 11:25
Compare
Choose a tag to compare
2.0.0-dev.1 Pre-release
Pre-release

first dev release of #18