Copied!
CloneableInstantiable
Constants
public Symfony\Component\Serializer\Encoder\XmlEncoder::AS_COLLECTION = 'as_collection'
public Symfony\Component\Serializer\Encoder\XmlEncoder::DECODER_IGNORED_NODE_TYPES = 'decoder_ignored_node_types'
 

An array of ignored XML node types while decoding, each one of the DOM Predefined XML_* constants.

public Symfony\Component\Serializer\Encoder\XmlEncoder::ENCODER_IGNORED_NODE_TYPES = 'encoder_ignored_node_types'
 

An array of ignored XML node types while encoding, each one of the DOM Predefined XML_* constants.

public Symfony\Component\Serializer\Encoder\XmlEncoder::ENCODING = 'xml_encoding'
public Symfony\Component\Serializer\Encoder\XmlEncoder::FORMAT = 'xml'
public Symfony\Component\Serializer\Encoder\XmlEncoder::FORMAT_OUTPUT = 'xml_format_output'
public Symfony\Component\Serializer\Encoder\XmlEncoder::LOAD_OPTIONS = 'load_options'
 

A bit field of LIBXML_* constants for loading XML documents.

public Symfony\Component\Serializer\Encoder\XmlEncoder::REMOVE_EMPTY_TAGS = 'remove_empty_tags'
public Symfony\Component\Serializer\Encoder\XmlEncoder::ROOT_NODE_NAME = 'xml_root_node_name'
public Symfony\Component\Serializer\Encoder\XmlEncoder::SAVE_OPTIONS = 'save_options'
 

A bit field of LIBXML_* constants for saving XML documents.

public Symfony\Component\Serializer\Encoder\XmlEncoder::STANDALONE = 'xml_standalone'
public Symfony\Component\Serializer\Encoder\XmlEncoder::TYPE_CAST_ATTRIBUTES = 'xml_type_cast_attributes'
public Symfony\Component\Serializer\Encoder\XmlEncoder::VERSION = 'xml_version'
Methods
public __construct(array $defaultContext = [])
public decode(string $data, string $format, array $context = []) : ?mixed
public encode(?mixed $data, string $format, array $context = []) : string
public setSerializer(Symfony\Component\Serializer\SerializerInterface $serializer)
 
  • return void
public supportsDecoding(string $format) : bool
public supportsEncoding(string $format) : bool
Properties
protected $serializer = NULL
 
  • var \SerializerInterface
Methods
protected final appendCData(DOMNode $node, string $val) : bool
protected final appendComment(DOMNode $node, string $data) : bool
protected final appendDocumentFragment(DOMNode $node, DOMDocumentFragment $fragment) : bool
protected final appendText(DOMNode $node, string $val) : bool
protected final appendXMLString(DOMNode $node, string $val) : bool
protected final isElementNameValid(string $name) : bool
 

Checks the name is a valid xml element name.

Properties
private array $defaultContext = ['as_collection' => false, 'decoder_ignored_node_types' => [7, 8], 'encoder_ignored_node_types' => [], 'load_options' => 2304, 'save_options' => 0, 'remove_empty_tags' => false, 'xml_root_node_name' => 'response', 'xml_type_cast_attributes' => true]
Methods
private appendNode(DOMNode $parentNode, ?mixed $data, string $format, array $context, string $nodeName, ?string $key = NULL) : bool
 

Selects the type of node to create and appends it to the parent.

private buildXml(DOMNode $parentNode, ?mixed $data, string $format, array $context, ?string $xmlRootNodeName = NULL) : bool
 

Parse the data and convert it to DOMElements.

  • throws \NotEncodableValueException
private createDomDocument(array $context) : DOMDocument
 

Create a DOM document, taking serializer options into account.

private needsCdataWrapping(string $val) : bool
 

Checks if a value contains any characters which would require CDATA wrapping.

private parseXml(DOMNode $node, array $context = []) : array|string
 

Parse the input DOMNode into an array or a string.

private parseXmlAttributes(DOMNode $node, array $context = []) : array
 

Parse the input DOMNode attributes into an array.

private parseXmlValue(DOMNode $node, array $context = []) : array|string
 

Parse the input DOMNode value (content and children) into an array or a string.

private selectNodeType(DOMNode $node, ?mixed $val, string $format, array $context) : bool
 

Tests the value being passed and decide what sort of element to create.

  • throws \NotEncodableValueException
© 2023 Bruce Wells
Search Namespaces \ Classes
Configuration