Yokai\EnumBundle\EnumInterface::getChoicesmust now return the enum labels as keys of the array.Yokai\EnumBundle\EnumInterface::getValueswas introduced and must return all possible enum values.Yokai\EnumBundle\EnumInterface::getLabelwas introduced and must return the associated label of any provided enum value.
Yokai\EnumBundle\AbstractTranslatedEnumwas removed, you can now extendYokai\EnumBundle\TranslatedEnumand provide values as constructor argument.Yokai\EnumBundle\ConfigurableTranslatedEnumwas removed, you can now extendYokai\EnumBundle\TranslatedEnuminstead.Yokai\EnumBundle\Enumwas introduced, you can now extend this class and provide choices and names as constructor arguments (recommended).
- Non enum classes were all made final.
enum_labelTwig function was removed (useenum_labelTwig filter instead).- Most methods now throw exceptions that implements (
Yokai\EnumBundle\Exception\ExceptionInterface).
- Due to how popular service discovering has become, doc will only show how to create an enum by creating a new class. But it is still 100% valid to create new enums without creating a class.