5use InvalidArgumentException;
 
   62    foreach (get_object_vars($valueObject) as 
$key => $val) {
 
   66            foreach ($val as $child) {
 
   70        } elseif ($val !== 
null) {
 
   99    foreach ($items as $item) {
 
  166    if (is_scalar($value)) {
 
  169        $writer->text($value);
 
  174        $value->xmlSerialize($writer);
 
  176    } elseif (is_object($value) && isset($writer->classMap[get_class($value)])) {
 
  179        $writer->classMap[get_class($value)]($writer, $value);
 
  181    } elseif (is_callable($value)) {
 
  186    } elseif (is_null($value)) {
 
  190    } elseif (is_array($value) && array_key_exists(
'name', $value)) {
 
  195        $name = $value[
'name'];
 
  196        $attributes = isset($value[
'attributes']) ? $value[
'attributes'] : [];
 
  197        $value = isset($value[
'value']) ? $value[
'value'] : 
null;
 
  201        $writer->
write($value);
 
  202        $writer->endElement();
 
  204    } elseif (is_array($value)) {
 
  206        foreach ($value as 
$name => $item) {
 
  214            } elseif (is_string(
$name) && is_array($item) && isset($item[
'attributes'])) {
 
  220                if (isset($item[
'value'])) {
 
  221                    $writer->
write($item[
'value']);
 
  223                $writer->endElement();
 
  225            } elseif (is_string(
$name)) {
 
  229                $writer->
write($item);
 
  230                $writer->endElement();
 
  234                throw new InvalidArgumentException(
'The writer does not know how to serialize arrays with keys of type: ' . gettype(
$name));
 
  239    } elseif (is_object($value)) {
 
  241        throw new InvalidArgumentException(
'The writer cannot serialize objects of class: ' . get_class($value));
 
  245        throw new InvalidArgumentException(
'The writer cannot serialize values of type: ' . gettype($value));
 
An exception for terminatinating execution or to throw for unit testing.
writeElement($name, $content=null)
Write a full element tag and it's contents.
startElement($name)
Opens a new element.
write($value)
Writes a value to the output stream.
writeAttributes(array $attributes)
Writes a list of attributes.
if($err=$client->getError()) $namespace
if(array_key_exists('yes', $_REQUEST)) $attributes
Objects implementing XmlSerializable can control how they are represented in Xml.
valueObject(Writer $writer, $valueObject, $namespace)
The valueObject serializer turns a simple PHP object into a classname.
standardSerializer(Writer $writer, $value)
This function is the 'default' serializer that is able to serialize most things, and delegates to oth...
repeatingElements(Writer $writer, array $items, $childElementName)
This serializer helps you serialize xml structures that look like this: