Skip to content

Commit 4ef6d43

Browse files
committed
Fix GreetingNormalizer::getSupportedTypes
`Error: Class App\Rest\Serializer\GreetingNormalizer contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (Symfony\Component\Serializer\Normalizer\NormalizerInterface::getSupportedTypes)`
1 parent e826328 commit 4ef6d43

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

code_samples/api/rest_api/src/Rest/Serializer/GreetingNormalizer.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,11 @@ public function normalize(mixed $object, ?string $format = null, array $context
3030

3131
return $this->normalizer->normalize($data, $format, $context);
3232
}
33+
34+
public function getSupportedTypes(?string $format): array
35+
{
36+
return [
37+
Greeting::class => true,
38+
];
39+
}
3340
}

0 commit comments

Comments
 (0)