| Total Complexity | 3 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 11 | final class DateTimeNormalizer implements NormalizerInterface, CacheableSupportsMethodInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * {@inheritdoc} |
||
| 15 | */ |
||
| 16 | 14 | public function normalize($object, string $format = null, array $context = []): ?string |
|
| 17 | { |
||
| 18 | 14 | return Carbon::instance($object)->toISOString(); |
|
| 19 | } |
||
| 20 | |||
| 21 | /** |
||
| 22 | * {@inheritdoc} |
||
| 23 | */ |
||
| 24 | 34 | public function supportsNormalization($data, string $format = null): bool |
|
| 25 | { |
||
| 26 | 34 | return $data instanceof \DateTime; |
|
| 27 | } |
||
| 28 | |||
| 29 | 34 | public function hasCacheableSupportsMethod(): bool |
|
| 32 | } |
||
| 33 | } |
||
| 34 |