Skip to content

Commit 706aaba

Browse files
yann-eugoneJ-Ben87
andauthored
Write 4.x upgrade note (#49)
* Write 4.x upgrade note * Apply suggestions from code review Co-authored-by: Benoit Jouhaud <[email protected]> Co-authored-by: Benoit Jouhaud <[email protected]>
1 parent dd89120 commit 706aaba

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

UPGRADE-4.x.md

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## Changes made in `EnumInterface`
2+
3+
- `Yokai\EnumBundle\EnumInterface::getChoices` must now return the enum labels as keys of the array.
4+
- `Yokai\EnumBundle\EnumInterface::getValues` was introduced
5+
and must return all possible enum values.
6+
- `Yokai\EnumBundle\EnumInterface::getLabel` was introduced
7+
and must return the associated label of any provided enum value.
8+
9+
## Changes made in enum base classes
10+
11+
- `Yokai\EnumBundle\AbstractTranslatedEnum` was removed,
12+
you can now extend `Yokai\EnumBundle\TranslatedEnum` and provide values as constructor argument.
13+
- `Yokai\EnumBundle\ConfigurableTranslatedEnum` was removed,
14+
you can now extend `Yokai\EnumBundle\TranslatedEnum` instead.
15+
- `Yokai\EnumBundle\Enum` was introduced,
16+
you can now extend this class and provide choices and names as constructor arguments (recommended).
17+
18+
## Changes made to other classes
19+
20+
- Non enum classes were all made final.
21+
- `enum_label` Twig function was removed (use `enum_label` Twig filter instead).
22+
- Most methods now throw exceptions that implements (`Yokai\EnumBundle\Exception\ExceptionInterface`).
23+
24+
## Changes made in documentation
25+
26+
- Due to how popular [service discovering](https://symfony.com/blog/new-in-symfony-3-3-psr-4-based-service-discovery) has become,
27+
doc will only show how to create an enum by creating a new class.
28+
But it is still 100% valid to create new enums without creating a class.

0 commit comments

Comments
 (0)