Total Complexity | 3 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | final class DateTimePlugin implements NormalizerProviderInterface, SchemaProviderInterface |
||
16 | { |
||
17 | /** |
||
18 | * @return NormalizerInterface[]|DenormalizerInterface[] |
||
19 | */ |
||
20 | public function getNormalizers(): array |
||
21 | { |
||
22 | return [ |
||
23 | new DateTimeNormalizer([DateTimeNormalizer::FORMAT_KEY => 'Y-m-d H:i:s']) |
||
24 | ]; |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @return Schema[] |
||
29 | */ |
||
30 | public function getDefinedStaticData(): array |
||
31 | { |
||
32 | AnnotationReader::addGlobalIgnoredName('alias'); |
||
33 | return [ |
||
34 | DateTimeInterface::class => new Schema(['type' => 'string', 'format' => 'date-time']) |
||
35 | ]; |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * @return callable[] |
||
40 | */ |
||
41 | public function getDynamicSchemaLogic(): array |
||
44 | } |
||
45 | } |
||
46 |