Skip to content

Commit 1deab82

Browse files
committed
Fix distance form type
1 parent 30dc2de commit 1deab82

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/Form/DistanceType.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,16 @@ public function buildForm(FormBuilderInterface $builder, array $options): void
2828
]);
2929

3030
$builder->addModelTransformer(new CallbackTransformer(
31-
function (?LengthUnitInterface $data): ?array {
31+
function (?Distance $data): ?array {
3232
if (null === $data) {
3333
return null;
3434
}
3535

36+
$value = $data->getValue();
37+
3638
return [
37-
'value' => (string) $data->getValue(),
38-
'unit' => $data::getUnitType(),
39+
'value' => (string) $value->getValue(),
40+
'unit' => $value::getUnitType(),
3941
];
4042
},
4143
function (?array $data): ?Distance {

0 commit comments

Comments
 (0)