From 98cc901b2aa18af5e0e8f7de548dcc17b60f5af7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerard=20Berengu=C3=A9?= Date: Fri, 3 Mar 2023 12:57:02 +0100 Subject: [PATCH] Update custom_normalizer.rst From Symfony 6.1 if uses ObjectNormalizer on constructor throw the error: App\Serializer\Normalizer\DescriptionNormalizer::__construct(): Argument #1 ($normalizer) must be of type Symfony\Component\Serializer\Normalizer\ObjectNormalizer, Symfony\Component\Serializer\Debug\TraceableNormalizer given --- serializer/custom_normalizer.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/serializer/custom_normalizer.rst b/serializer/custom_normalizer.rst index fa7aa1f0094..cac02eaaddc 100644 --- a/serializer/custom_normalizer.rst +++ b/serializer/custom_normalizer.rst @@ -23,14 +23,13 @@ to customize the normalized data. To do that, leverage the ``ObjectNormalizer``: use App\Entity\Topic; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Serializer\Normalizer\NormalizerInterface; - use Symfony\Component\Serializer\Normalizer\ObjectNormalizer; class TopicNormalizer implements NormalizerInterface { private $router; private $normalizer; - public function __construct(UrlGeneratorInterface $router, ObjectNormalizer $normalizer) + public function __construct(UrlGeneratorInterface $router, NormalizerInterface $normalizer) { $this->router = $router; $this->normalizer = $normalizer;