if ($this->encoder->
needsNormalization($format,
$context)) { $data =
$this->
normalize($data,
$format,
$context);
} return $this->
encode($data,
$format,
$context);
} final public function deserialize(mixed
$data, string
$type, string
$format, array
$context =
[]): mixed
{ if (!
$this->
supportsDecoding($format,
$context)) { throw new UnsupportedFormatException(sprintf('Deserialization for the format "%s" is not supported.',
$format));
} $data =
$this->
decode($data,
$format,
$context);
return $this->
denormalize($data,
$type,
$format,
$context);
} public function normalize(mixed
$data, string
$format = null, array
$context =
[]): array|string|int|float|bool|\ArrayObject|null
{ // If a normalizer supports the given data, use it