All notable changes to enum-helper will be documented in this file.
fix: error on null value in EnumFrom@wrap in strict mode by @Carnicero90
- add strict option to
wrap()method by @Carnicero90
- fix '0' intBackedENum error on
wrapmethod
- fix invokable with enum case like LESS_5
- add
wrap()method toEnumFromtrait - change
EnumUniqueIdtoEnumSerializationtrait and change separator to:: - add
EnumLabeltrait if you prefer use ->label() istead of ->desceription() - add new
EnumPropertiestrait - general refactoring
- update pest and phpstan versions
- add pint formatting
- update github workflow
- Add
nullableDescriptionsByValuemethod
- v 1.0 🚀 🎉
- Added Inspection methods (
isPure(),isBacked(),has(),doesntHave(),hasName(),doesntHaveName(),hasValue(),doesntHaveValue()) - Refactored readme examples and test classes name
- permit enum equality to compare IntBackedEnum with numeric string
- added support of null param on
in()andnotIn()methods
After migrating several projects with my fellow @RobertoNegro and listening to different opinions we have decided to simplify the package.
From now on, I will consider a pure enum as a StringBackedEnum with names as values, so all ***AsSelect() methods will be replaced by ***ByValue() methods.
- removed all methods
***AsSelect() - added support on
***ByValue()methods also for pure enum using name instead value - removed
NotBackedEnumexception
- added
fromValue()andtryFromValue()aliases - refactored EnumFromTest.php
- set public dynamic methods
- moved the Laravel part of package to new
laravel-enum-helperpackage - updated the banner
- moved
LaravelEnumtoDatomatic\EnumHelper\Traits\Laravelnamespace - code refactor
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:
NotBackedEnumEmptyCasesUndefinedStaticMethod
Added dynamic methods on LaravelEnum trait
- Fixed README.md
- Added return type on InvalidUniqueId exception
- Merge translations and descriptions
- Move UniqueId out of EnumHelper
First release 🚀