Releases: datomatic/enum-helper
Releases · datomatic/enum-helper
v0.4.0
Renamed these methods:
namesArray()
=>namesByValue()
valuesArray()
=>valuesByName()
descriptionsArray()
splitted into 2 methods descriptionsByName()
, descriptionsByValue()
Renamed EnumLaravelLocalization
trait to LaravelEnum
Added new [method]AsSelect()
methods that return [method]ByValue()
if is BackedEnum
, [method]ByName()
otherwise.
Added these exceptions:
NotBackedEnum
EmptyCases
UndefinedStaticMethod
Added dynamic methods on LaravelEnum trait
v0.3.1
v0.3.0
v0.2.0
Enum Helper (v0.2.0)
A simple and opinionated collections of PHP 8.1 enum helpers
- Invokable cases: get the value of enum "invoking" it statically
- Construct enum by name or value:
from()
,tryFrom()
,fromName()
,tryFromName()
for all enums - Enums Equality:
is()
,isNot()
,in()
,notIn()
methods - Names: methods to have a list of case names (
names()
,namesArray()
) - Values: methods to have a list of case values (
values()
,valuesArray()
) - Unique ID: get an unique identifier from instance or instance from identifier (
uniqueId()
,fromUniqueId()
) - Descriptions: add description method and relative utilities to an enum (
description()
,descriptions()
,descriptionsArray()
) - Translations: use enums on a multilanguage project (
translate()
,translations()
,translationsArray()
)