// @deprecated remove condition in 7.0
if (!
method_exists($this->normalizer, 'getSupportedTypes'
)) { return ['*' =>
$this->normalizer instanceof CacheableSupportsMethodInterface &&
$this->normalizer->
hasCacheableSupportsMethod()];
} return $this->normalizer->
getSupportedTypes($format);
} public function normalize(mixed
$object, string
$format = null, array
$context =
[]): array|string|int|float|bool|\ArrayObject|null
{ if (!
$this->normalizer instanceof NormalizerInterface
) { throw new \
BadMethodCallException(sprintf('The "%s()" method cannot be called as nested normalizer doesn\'t implements "%s".', __METHOD__, NormalizerInterface::
class));
} $startTime =
microtime(true
);
$normalized =
$this->normalizer->
normalize($object,
$format,
$context);
$time =
microtime(true
) -
$startTime;
if ($traceId =
($context[TraceableSerializer::DEBUG_TRACE_ID
] ?? null
)) { $this->dataCollector->
collectNormalization($traceId,
$this->normalizer::
class,
$time);
} return $normalized;
}