Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
18 | 9 | public function createSerialzer( |
|
19 | MetadataFactoryInterface $metadataFactory, |
||
20 | string $dateFormat = 'Y-m-d H:i:s' |
||
21 | ): SerializerInterface { |
||
22 | 9 | return new Serializer( |
|
23 | [ |
||
24 | 9 | new ObjectNormalizer( |
|
25 | 9 | new Normalizer($metadataFactory), |
|
26 | 9 | new Denormalizer(new ObjectHydrator($metadataFactory)) |
|
27 | ), |
||
28 | 9 | new DateTimeNormalizer($dateFormat) |
|
29 | ], |
||
30 | [ |
||
31 | 9 | new JsonEncoder(), |
|
32 | 9 | new XmlEncoder() |
|
33 | ] |
||
37 |