Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitcba52b5

Browse files
committed
do not depend on concrete NormalizerInterface implementations
1 parent430f4ef commitcba52b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎serializer/custom_normalizer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ 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\ContextAwareNormalizerInterface;
26-
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
26+
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
2727

2828
class TopicNormalizer implements ContextAwareNormalizerInterface
2929
{
3030
private $router;
3131
private $normalizer;
3232

33-
public function __construct(UrlGeneratorInterface $router,ObjectNormalizer $normalizer)
33+
public function __construct(UrlGeneratorInterface $router,NormalizerInterface $normalizer)
3434
{
3535
$this->router = $router;
3636
$this->normalizer = $normalizer;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp