Skip to content

Commit

Permalink
Merge pull request #2 from lsv/feature/symfony7
Browse files Browse the repository at this point in the history
Added FormErrorNormalizer return statements
  • Loading branch information
tacman authored Oct 15, 2024
2 parents 24c359d + 0ffe666 commit 15751aa
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(private readonly TranslatorInterface $translator)
/**
* {@inheritdoc}
*/
public function normalize($object, $format = null, array $context = []): float|array|\ArrayObject|bool|int|string|null
public function normalize($object, $format = null, array $context = []): array|string|int|float|bool|\ArrayObject|null
{
return [
'code' => $context['status_code'] ?? null,
Expand All @@ -55,6 +55,11 @@ public function supportsNormalization($data, $format = null, array $context = []
return $data instanceof FormInterface && $data->isSubmitted() && !$data->isValid();
}

public function getSupportedTypes(?string $format): array
{
return [Form::class];
}

/**
* This code has been taken from JMSSerializer.
*
Expand Down

0 comments on commit 15751aa

Please sign in to comment.