Skip to content

Commit 98cc901

Browse files
authored
Update custom_normalizer.rst
From Symfony 6.1 if uses ObjectNormalizer on constructor throw the error: App\Serializer\Normalizer\DescriptionNormalizer::__construct(): Argument symfony#1 ($normalizer) must be of type Symfony\Component\Serializer\Normalizer\ObjectNormalizer, Symfony\Component\Serializer\Debug\TraceableNormalizer given
1 parent 9ce082c commit 98cc901

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

serializer/custom_normalizer.rst

+1-2
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,13 @@ to customize the normalized data. To do that, leverage the ``ObjectNormalizer``:
2323
use App\Entity\Topic;
2424
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
2525
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
26-
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
2726

2827
class TopicNormalizer implements NormalizerInterface
2928
{
3029
private $router;
3130
private $normalizer;
3231

33-
public function __construct(UrlGeneratorInterface $router, ObjectNormalizer $normalizer)
32+
public function __construct(UrlGeneratorInterface $router, NormalizerInterface $normalizer)
3433
{
3534
$this->router = $router;
3635
$this->normalizer = $normalizer;

0 commit comments

Comments
 (0)