| Total Complexity | 4 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 64.71% |
| 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 | 94 | public function __construct(AbstractNormalizer $normalizer) |
|
| 20 | { |
||
| 21 | 94 | $this->normalizer = $normalizer; |
|
| 22 | 94 | } |
|
| 23 | |||
| 24 | /** |
||
| 25 | * {@inheritdoc} |
||
| 26 | */ |
||
| 27 | 94 | public function normalize($object, $format = null, array $context = []) |
|
| 28 | { |
||
| 29 | 94 | $data = $this->normalizer->normalize($object, $format, $context); |
|
| 30 | |||
| 31 | return \array_filter($data, static function ($value) { |
||
| 32 | 86 | return null !== $value; |
|
| 33 | 94 | }); |
|
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * {@inheritdoc} |
||
| 38 | */ |
||
| 39 | 94 | public function supportsNormalization($data, $format = null) |
|
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * {@inheritdoc} |
||
| 46 | */ |
||
| 47 | 94 | public function setSerializer(SerializerInterface $serializer) |
|
| 50 | 94 | } |
|
| 51 | } |
||
| 52 |