109        if (is_resource(
$input)) {
 
  119        $rootElementName = 
$result[
'name'];
 
  145        if (is_resource(
$input)) {
 
  154        $rootElementName = (array)$rootElementName;
 
  156        foreach ($rootElementName as &$rEl) {
 
  157            if ($rEl[0] !== 
'{') $rEl = 
'{}' . $rEl;
 
  161        if (!in_array(
$result[
'name'], $rootElementName, 
true)) {
 
  162            throw new ParseException(
'Expected ' . implode(
' or ', (array)$rootElementName) . 
' but received ' . 
$result[
'name'] . 
' as the root element');
 
  193        $w->writeElement($rootElementName, $value);
 
  194        return $w->outputMemory();
 
  232        $this->classMap[$className] = 
function(
Writer $writer, $valueObject) use (
$namespace) {
 
  235        $this->valueObjectMap[$className] = $elementName;
 
  253        if (!isset($this->valueObjectMap[get_class($object)])) {
 
  254            throw new \InvalidArgumentException(
'"' . get_class($object) . 
'" is not a registered value object class. Register your class with mapValueObject.');
 
  257            $this->valueObjectMap[get_class($object)],
 
  277        if (!isset($cache[$str])) {
 
  279            if (!preg_match(
'/^{([^}]*)}(.*)$/', $str, $matches)) {
 
  280                throw new \InvalidArgumentException(
'\'' . $str . 
'\' is not a valid clark-notation formatted 
string'); 
  295    protected $valueObjectMap = []; 
An exception for terminatinating execution or to throw for unit testing.
This is a base exception for any exception related to parsing xml files.
The Reader class expands upon PHP's built-in XMLReader.
XML parsing and writing service.
expect($rootElementName, $input, $contextUri=null)
Parses a document in full, and specify what the expected root element name is.
writeValueObject($object, $contextUri=null)
Writes a value object.
write($rootElementName, $value, $contextUri=null)
Generates an XML document in one go.
mapValueObject($elementName, $className)
Map an xml element to a PHP class.
static parseClarkNotation($str)
Parses a clark-notation string, and returns the namespace and element name components.
parse($input, $contextUri=null, &$rootElementName=null)
Parses a document in full.
getWriter()
Returns a fresh xml writer.
getReader()
Returns a fresh XML Reader.
if($err=$client->getError()) $namespace
valueObject(Reader $reader, $className, $namespace)
The valueObject deserializer turns an xml element into a PHP object of a specific class.