Skip to content

Commit

Permalink
5984 fix finding selected enum value in choices (linter)
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvsk committed Nov 1, 2023
1 parent ef21a9b commit 7fde28c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Field/Configurator/ChoiceConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function configure(FieldDto $field, EntityDto $entityDto, AdminContext $c
// Translatable choice don't need to get flipped
$flippedChoices = $areChoicesTranslatable ? $choices : array_flip($this->flatten($choices));
foreach ((array) $fieldValue as $selectedValue) {
$selectedValue = match(true) {
$selectedValue = match (true) {
$selectedValue instanceof \BackedEnum => $selectedValue->value,
$selectedValue instanceof \UnitEnum => $selectedValue->name,
default => $selectedValue
Expand Down

0 comments on commit 7fde28c

Please sign in to comment.