Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

SerializerTrait.php
Go to the documentation of this file.
1 <?php
2
7 declare(strict_types=1);
8
9 namespace eZ\Publish\Core\MVC\Symfony\Component\Serializer;
10
11 use Symfony\Component\Serializer\Encoder\JsonEncoder;
12 use Symfony\Component\Serializer\Normalizer\PropertyNormalizer;
13 use Symfony\Component\Serializer\Serializer;
14 use Symfony\Component\Serializer\SerializerInterface;
15
16 trait SerializerTrait
17 {
18 public function getSerializer(): SerializerInterface
19 {
20 return new Serializer(
21 [
22 new CompoundMatcherNormalizer(),
23 new HostElementNormalizer(),
24 new MapNormalizer(),
25 new URITextNormalizer(),
26 new HostTextNormalizer(),
27 new RegexURINormalizer(),
28 new RegexHostNormalizer(),
29 new RegexNormalizer(),
30 new URIElementNormalizer(),
31 new SimplifiedRequestNormalizer(),
32 (new PropertyNormalizer())->setIgnoredAttributes(['request', 'container', 'matcherBuilder']),
33 ],
34 [new JsonEncoder()]
35 );
36 }
37 }
eZ\Publish\Core\MVC\Symfony\Component\Serializer
Definition: AbstractPropertyWhitelistNormalizer.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.