You are here

public function XmlEncoder::decode in Zircon Profile 8

Same name in this branch
  1. 8 vendor/symfony/serializer/Encoder/XmlEncoder.php \Symfony\Component\Serializer\Encoder\XmlEncoder::decode()
  2. 8 core/modules/serialization/src/Encoder/XmlEncoder.php \Drupal\serialization\Encoder\XmlEncoder::decode()
Same name and namespace in other branches
  1. 8.0 core/modules/serialization/src/Encoder/XmlEncoder.php \Drupal\serialization\Encoder\XmlEncoder::decode()

Decodes a string into PHP data.

Parameters

string $data Data to decode:

string $format Format name:

array $context options that decoders have access to.:

The format parameter specifies which format the data is in; valid values depend on the specific implementation. Authors implementing this interface are encouraged to document which formats they support in a non-inherited phpdoc comment.

Return value

mixed

Throws

UnexpectedValueException

Overrides DecoderInterface::decode

File

core/modules/serialization/src/Encoder/XmlEncoder.php, line 76
Contains \Drupal\serialization\Encoder\XmlEncoder.

Class

XmlEncoder
Adds XML support for serializer.

Namespace

Drupal\serialization\Encoder

Code

public function decode($data, $format, array $context = array()) {
  return $this
    ->getBaseEncoder()
    ->decode($data, $format, $context);
}