Copied!
AbstractInterface
Methods
public abstract deserialize(?mixed $data, string $type, string $format, array $context = []) : ?mixed
 

Deserializes data into the given type.

  • template
  • template
  • param \TType $type
  • param array<string,mixed> $context
  • phpstan-return ($type is class-string<TObject> ? TObject : mixed)
  • psalm-return (TType is class-string<TObject> ? TObject : mixed)
  • throws \NotNormalizableValueException Occurs when a value cannot be denormalized
  • throws \UnexpectedValueException Occurs when a value cannot be decoded
  • throws \ExceptionInterface Occurs for all the other cases of serialization-related errors
public abstract serialize(?mixed $data, string $format, array $context = []) : string
 

Serializes data in the appropriate format.

  • param array<string,mixed> $context Options normalizers/encoders have access to
  • throws \NotNormalizableValueException Occurs when a value cannot be normalized
  • throws \UnexpectedValueException Occurs when a value cannot be encoded
  • throws \ExceptionInterface Occurs for all the other cases of serialization-related errors
© 2025 Bruce Wells