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