Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cba52b5

Browse files
committed
do not depend on concrete NormalizerInterface implementations
1 parent 430f4ef commit cba52b5

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)