Total Complexity | 4 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
12 | class LegacyObjectNormalizerWrapper implements NormalizerInterface, SerializerAwareInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var NormalizerInterface |
||
16 | */ |
||
17 | private $normalizer; |
||
18 | |||
19 | public function __construct(AbstractNormalizer $normalizer) |
||
20 | { |
||
21 | $this->normalizer = $normalizer; |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * {@inheritdoc} |
||
26 | */ |
||
27 | public function normalize($object, $format = null, array $context = []) |
||
28 | { |
||
29 | $data = $this->normalizer->normalize($object, $format, $context); |
||
30 | |||
31 | return \array_filter($data, static function ($value) { |
||
32 | return null !== $value; |
||
33 | }); |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | public function supportsNormalization($data, $format = null) |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | public function setSerializer(SerializerInterface $serializer) |
||
50 | } |
||
51 | } |
||
52 |