function TraceableSerializer::decode
Overrides DecoderInterface::decode
File
-
vendor/
symfony/ serializer/ Debug/ TraceableSerializer.php, line 114
Class
- TraceableSerializer
- Collects some data about serialization.
Namespace
Symfony\Component\Serializer\DebugCode
public function decode(string $data, string $format, array $context = []) : mixed {
$context[self::DEBUG_TRACE_ID] = $traceId = bin2hex(random_bytes(4));
$startTime = microtime(true);
$result = $this->serializer
->decode($data, $format, $context);
$time = microtime(true) - $startTime;
$caller = $this->getCaller(__FUNCTION__, DecoderInterface::class);
$this->dataCollector
->collectDecode($traceId, $data, $format, $context, $time, $caller, $this->serializerName);
return $result;
}