You are here

final public function Serializer::deserialize in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/serializer/Serializer.php \Symfony\Component\Serializer\Serializer::deserialize()

Deserializes data into the given type.

Parameters

mixed $data:

string $type:

string $format:

array $context:

Return value

object

Overrides SerializerInterface::deserialize

File

vendor/symfony/serializer/Serializer.php, line 106

Class

Serializer
Serializer serializes and deserializes data.

Namespace

Symfony\Component\Serializer

Code

public final function deserialize($data, $type, $format, array $context = array()) {
  if (!$this
    ->supportsDecoding($format)) {
    throw new UnexpectedValueException(sprintf('Deserialization for the format %s is not supported', $format));
  }
  $data = $this
    ->decode($data, $format, $context);
  return $this
    ->denormalize($data, $type, $format, $context);
}