for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Serializer\Normalizer;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
/**
* DateTimeNormalizer.
*/
class DateTimeNormalizer implements NormalizerInterface
{
* {@inheritdoc}
public function normalize($object, $format = null, array $context = [])
/* @var \DateTime $object */
return $object->format(\DateTime::ATOM);
}
public function supportsNormalization($data, $format = null)
return $data instanceof \DateTime;