Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 98cc901

Browse filesBrowse 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
Copy full SHA for 98cc901

File tree

Expand file treeCollapse file tree

1 file changed

+1
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-2
lines changed

‎serializer/custom_normalizer.rst

Copy file name to clipboardExpand all lines: serializer/custom_normalizer.rst
+1-2Lines changed: 1 addition & 2 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.