Copied!

Normalizes an instance of {@see \DateInterval} to an interval string.

Denormalizes an interval string to an instance of {@see \DateInterval}.

CloneableFinalInstantiable
Constants
public Symfony\Component\Serializer\Normalizer\DenormalizerInterface::COLLECT_DENORMALIZATION_ERRORS = 'collect_denormalization_errors'
public Symfony\Component\Serializer\Normalizer\DateIntervalNormalizer::FORMAT_KEY = 'dateinterval_format'
Methods
public __construct(array $defaultContext = [])
public denormalize(?mixed $data, string $type, ?string $format = NULL, array $context = []) : DateInterval
 
  • throws \NotNormalizableValueException
public getSupportedTypes(?string $format) : array
public normalize(?mixed $object, ?string $format = NULL, array $context = []) : string
 
  • throws \InvalidArgumentException
public supportsDenormalization(?mixed $data, string $type, ?string $format = NULL, array $context = []) : bool
public supportsNormalization(?mixed $data, ?string $format = NULL, array $context = []) : bool
Properties
private array $defaultContext = ['dateinterval_format' => '%rP%yY%mM%dDT%hH%iM%sS']
Methods
private isISO8601(string $string) : bool
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration