mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Sabre/Xml 4.0.4 for #1311
This commit is contained in:
parent
70a2ebb671
commit
c8baabf8d9
15 changed files with 49 additions and 49 deletions
|
|
@ -63,7 +63,7 @@ trait ContextStackTrait
|
||||||
* The writer may use this if you attempt to serialize an object with a
|
* The writer may use this if you attempt to serialize an object with a
|
||||||
* class that does not implement XmlSerializable.
|
* class that does not implement XmlSerializable.
|
||||||
*
|
*
|
||||||
* Instead it will look at this classmap to see if there is a custom
|
* Instead, it will look at this classmap to see if there is a custom
|
||||||
* serializer here. This is useful if you don't want your value objects
|
* serializer here. This is useful if you don't want your value objects
|
||||||
* to be responsible for serializing themselves.
|
* to be responsible for serializing themselves.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -145,6 +145,7 @@ function keyValue(Reader $reader, string $namespace = null): array
|
||||||
* ];
|
* ];
|
||||||
*
|
*
|
||||||
* @return string[]
|
* @return string[]
|
||||||
|
*
|
||||||
* @phpstan-return list<string>
|
* @phpstan-return list<string>
|
||||||
*/
|
*/
|
||||||
function enum(Reader $reader, string $namespace = null): array
|
function enum(Reader $reader, string $namespace = null): array
|
||||||
|
|
@ -186,7 +187,7 @@ function enum(Reader $reader, string $namespace = null): array
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The valueObject deserializer turns an xml element into a PHP object of
|
* The valueObject deserializer turns an XML element into a PHP object of
|
||||||
* a specific class.
|
* a specific class.
|
||||||
*
|
*
|
||||||
* This is primarily used by the mapValueObject function from the Service
|
* This is primarily used by the mapValueObject function from the Service
|
||||||
|
|
@ -195,6 +196,7 @@ function enum(Reader $reader, string $namespace = null): array
|
||||||
* @template C of object
|
* @template C of object
|
||||||
*
|
*
|
||||||
* @param class-string<C> $className
|
* @param class-string<C> $className
|
||||||
|
*
|
||||||
* @phpstan-return C
|
* @phpstan-return C
|
||||||
*/
|
*/
|
||||||
function valueObject(Reader $reader, string $className, string $namespace): object
|
function valueObject(Reader $reader, string $className, string $namespace): object
|
||||||
|
|
@ -222,7 +224,7 @@ function valueObject(Reader $reader, string $className, string $namespace): obje
|
||||||
$reader->next();
|
$reader->next();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!$reader->read()) {
|
if (Reader::END_ELEMENT !== $reader->nodeType && !$reader->read()) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,16 +20,14 @@ use Sabre\Xml;
|
||||||
class Base implements Xml\Element
|
class Base implements Xml\Element
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* PHP value to serialize.
|
* @var mixed PHP value to serialize
|
||||||
*
|
|
||||||
* @var mixed
|
|
||||||
*/
|
*/
|
||||||
protected $value;
|
protected $value;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param mixed $value
|
* @param mixed $value PHP value to serialize
|
||||||
*/
|
*/
|
||||||
public function __construct($value = null)
|
public function __construct($value = null)
|
||||||
{
|
{
|
||||||
|
|
@ -75,7 +73,7 @@ class Base implements Xml\Element
|
||||||
* $reader->parseInnerTree() will parse the entire sub-tree, and advance to
|
* $reader->parseInnerTree() will parse the entire sub-tree, and advance to
|
||||||
* the next element.
|
* the next element.
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return array<int,array<string, mixed>>|string|null
|
||||||
*/
|
*/
|
||||||
public static function xmlDeserialize(Xml\Reader $reader)
|
public static function xmlDeserialize(Xml\Reader $reader)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ class Elements implements Xml\Element
|
||||||
*
|
*
|
||||||
* @return string[]
|
* @return string[]
|
||||||
*/
|
*/
|
||||||
public static function xmlDeserialize(Xml\Reader $reader): array
|
public static function xmlDeserialize(Xml\Reader $reader)
|
||||||
{
|
{
|
||||||
require_once __DIR__ . '/../Deserializer/functions.php';
|
require_once __DIR__ . '/../Deserializer/functions.php';
|
||||||
return Deserializer\enum($reader);
|
return Deserializer\enum($reader);
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@ class KeyValue implements Xml\Element
|
||||||
*/
|
*/
|
||||||
public function xmlSerialize(Xml\Writer $writer): void
|
public function xmlSerialize(Xml\Writer $writer): void
|
||||||
{
|
{
|
||||||
|
require_once __DIR__ . '/Serializer/functions.php';
|
||||||
$writer->write($this->value);
|
$writer->write($this->value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -95,7 +96,7 @@ class KeyValue implements Xml\Element
|
||||||
*
|
*
|
||||||
* @return array<string, mixed>
|
* @return array<string, mixed>
|
||||||
*/
|
*/
|
||||||
public static function xmlDeserialize(Xml\Reader $reader): array
|
public static function xmlDeserialize(Xml\Reader $reader)
|
||||||
{
|
{
|
||||||
require_once __DIR__ . '/../Deserializer/functions.php';
|
require_once __DIR__ . '/../Deserializer/functions.php';
|
||||||
return Deserializer\keyValue($reader);
|
return Deserializer\keyValue($reader);
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,10 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Sabre\Xml\Element;
|
namespace Sabre\Xml\Element;
|
||||||
|
|
||||||
use function Sabre\Uri\resolve;
|
|
||||||
|
|
||||||
use Sabre\Xml;
|
use Sabre\Xml;
|
||||||
|
|
||||||
|
use function Sabre\Uri\resolve;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uri element.
|
* Uri element.
|
||||||
*
|
*
|
||||||
|
|
@ -59,7 +59,7 @@ class Uri implements Xml\Element
|
||||||
{
|
{
|
||||||
$writer->text(
|
$writer->text(
|
||||||
resolve(
|
resolve(
|
||||||
$writer->contextUri,
|
$writer->contextUri ?? '',
|
||||||
$this->value
|
$this->value
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
@ -83,7 +83,7 @@ class Uri implements Xml\Element
|
||||||
* $reader->parseSubTree() will parse the entire sub-tree, and advance to
|
* $reader->parseSubTree() will parse the entire sub-tree, and advance to
|
||||||
* the next element.
|
* the next element.
|
||||||
*/
|
*/
|
||||||
public static function xmlDeserialize(Xml\Reader $reader): Uri
|
public static function xmlDeserialize(Xml\Reader $reader)
|
||||||
{
|
{
|
||||||
return new self(
|
return new self(
|
||||||
resolve(
|
resolve(
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ XML;
|
||||||
* $reader->parseInnerTree() will parse the entire sub-tree, and advance to
|
* $reader->parseInnerTree() will parse the entire sub-tree, and advance to
|
||||||
* the next element.
|
* the next element.
|
||||||
*/
|
*/
|
||||||
public static function xmlDeserialize(Reader $reader): XmlFragment
|
public static function xmlDeserialize(Reader $reader)
|
||||||
{
|
{
|
||||||
$result = new self($reader->readInnerXml());
|
$result = new self($reader->readInnerXml());
|
||||||
$reader->next();
|
$reader->next();
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
||||||
namespace Sabre\Xml;
|
namespace Sabre\Xml;
|
||||||
|
|
||||||
use LibXMLError;
|
use LibXMLError;
|
||||||
use Throwable;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This exception is thrown when the Reader runs into a parsing error.
|
* This exception is thrown when the Reader runs into a parsing error.
|
||||||
|
|
@ -30,9 +29,9 @@ class LibXMLException extends ParseException
|
||||||
*
|
*
|
||||||
* You should pass a list of LibXMLError objects in its constructor.
|
* You should pass a list of LibXMLError objects in its constructor.
|
||||||
*
|
*
|
||||||
* @param LibXMLError[] $errors
|
* @param \LibXMLError[] $errors
|
||||||
*/
|
*/
|
||||||
public function __construct(array $errors, int $code = 0, Throwable $previousException = null)
|
public function __construct(array $errors, int $code = 0, \Throwable $previousException = null)
|
||||||
{
|
{
|
||||||
$this->errors = $errors;
|
$this->errors = $errors;
|
||||||
parent::__construct($errors[0]->message.' on line '.$errors[0]->line.', column '.$errors[0]->column, $code, $previousException);
|
parent::__construct($errors[0]->message.' on line '.$errors[0]->line.', column '.$errors[0]->column, $code, $previousException);
|
||||||
|
|
@ -41,7 +40,7 @@ class LibXMLException extends ParseException
|
||||||
/**
|
/**
|
||||||
* Returns the LibXML errors.
|
* Returns the LibXML errors.
|
||||||
*
|
*
|
||||||
* @return LibXMLError[]
|
* @return \LibXMLError[]
|
||||||
*/
|
*/
|
||||||
public function getErrors(): array
|
public function getErrors(): array
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,6 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Sabre\Xml;
|
namespace Sabre\Xml;
|
||||||
|
|
||||||
use Exception;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a base exception for any exception related to parsing xml files.
|
* This is a base exception for any exception related to parsing xml files.
|
||||||
*
|
*
|
||||||
|
|
@ -13,6 +11,6 @@ use Exception;
|
||||||
* @author Evert Pot (http://evertpot.com/)
|
* @author Evert Pot (http://evertpot.com/)
|
||||||
* @license http://sabre.io/license/ Modified BSD License
|
* @license http://sabre.io/license/ Modified BSD License
|
||||||
*/
|
*/
|
||||||
class ParseException extends Exception
|
class ParseException extends \Exception
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ use XMLReader;
|
||||||
* @author Evert Pot (http://evertpot.com/)
|
* @author Evert Pot (http://evertpot.com/)
|
||||||
* @license http://sabre.io/license/ Modified BSD License
|
* @license http://sabre.io/license/ Modified BSD License
|
||||||
*/
|
*/
|
||||||
class Reader extends XMLReader
|
class Reader extends \XMLReader
|
||||||
{
|
{
|
||||||
use ContextStackTrait;
|
use ContextStackTrait;
|
||||||
|
|
||||||
|
|
@ -105,7 +105,7 @@ class Reader extends XMLReader
|
||||||
*
|
*
|
||||||
* @param array<string, mixed>|null $elementMap
|
* @param array<string, mixed>|null $elementMap
|
||||||
*
|
*
|
||||||
* @return array<string, mixed>
|
* @return array<int,array<string, mixed>>
|
||||||
*/
|
*/
|
||||||
public function parseGetElements(array $elementMap = null): array
|
public function parseGetElements(array $elementMap = null): array
|
||||||
{
|
{
|
||||||
|
|
@ -130,7 +130,7 @@ class Reader extends XMLReader
|
||||||
*
|
*
|
||||||
* @param array<string, mixed>|null $elementMap
|
* @param array<string, mixed>|null $elementMap
|
||||||
*
|
*
|
||||||
* @return array<string, mixed>|string|null
|
* @return array<int,array<string, mixed>>|string|null
|
||||||
*/
|
*/
|
||||||
public function parseInnerTree(array $elementMap = null)
|
public function parseInnerTree(array $elementMap = null)
|
||||||
{
|
{
|
||||||
|
|
@ -211,7 +211,7 @@ class Reader extends XMLReader
|
||||||
$previousDepth = $this->depth;
|
$previousDepth = $this->depth;
|
||||||
|
|
||||||
while ($this->read() && $this->depth != $previousDepth) {
|
while ($this->read() && $this->depth != $previousDepth) {
|
||||||
if (in_array($this->nodeType, [XMLReader::TEXT, XMLReader::CDATA, XMLReader::WHITESPACE])) {
|
if (in_array($this->nodeType, [\XMLReader::TEXT, \XMLReader::CDATA, \XMLReader::WHITESPACE])) {
|
||||||
$result .= $this->value;
|
$result .= $this->value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -298,14 +298,14 @@ class Reader extends XMLReader
|
||||||
}
|
}
|
||||||
|
|
||||||
$deserializer = $this->elementMap[$name];
|
$deserializer = $this->elementMap[$name];
|
||||||
if (is_subclass_of($deserializer, 'Sabre\\Xml\\XmlDeserializable')) {
|
|
||||||
return [$deserializer, 'xmlDeserialize'];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_callable($deserializer)) {
|
if (is_callable($deserializer)) {
|
||||||
return $deserializer;
|
return $deserializer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (is_subclass_of($deserializer, 'Sabre\\Xml\\XmlDeserializable')) {
|
||||||
|
return [$deserializer, 'xmlDeserialize'];
|
||||||
|
}
|
||||||
|
|
||||||
$type = gettype($deserializer);
|
$type = gettype($deserializer);
|
||||||
if (is_string($deserializer)) {
|
if (is_string($deserializer)) {
|
||||||
$type .= ' ('.$deserializer.')';
|
$type .= ' ('.$deserializer.')';
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace Sabre\Xml\Serializer;
|
namespace Sabre\Xml\Serializer;
|
||||||
|
|
||||||
use InvalidArgumentException;
|
|
||||||
use Sabre\Xml\Writer;
|
use Sabre\Xml\Writer;
|
||||||
use Sabre\Xml\XmlSerializable;
|
use Sabre\Xml\XmlSerializable;
|
||||||
|
|
||||||
|
|
@ -48,7 +47,7 @@ function enum(Writer $writer, array $values): void
|
||||||
/**
|
/**
|
||||||
* The valueObject serializer turns a simple PHP object into a classname.
|
* The valueObject serializer turns a simple PHP object into a classname.
|
||||||
*
|
*
|
||||||
* Every public property will be encoded as an xml element with the same
|
* Every public property will be encoded as an XML element with the same
|
||||||
* name, in the XML namespace as specified.
|
* name, in the XML namespace as specified.
|
||||||
*
|
*
|
||||||
* Values that are set to null or an empty array are not serialized. To
|
* Values that are set to null or an empty array are not serialized. To
|
||||||
|
|
@ -173,12 +172,12 @@ function standardSerializer(Writer $writer, $value): void
|
||||||
$writer->write($item);
|
$writer->write($item);
|
||||||
$writer->endElement();
|
$writer->endElement();
|
||||||
} else {
|
} else {
|
||||||
throw new InvalidArgumentException('The writer does not know how to serialize arrays with keys of type: '.gettype($name));
|
throw new \InvalidArgumentException('The writer does not know how to serialize arrays with keys of type: '.gettype($name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif (is_object($value)) {
|
} elseif (is_object($value)) {
|
||||||
throw new InvalidArgumentException('The writer cannot serialize objects of class: '.get_class($value));
|
throw new \InvalidArgumentException('The writer cannot serialize objects of class: '.get_class($value));
|
||||||
} elseif (!is_null($value)) {
|
} elseif (!is_null($value)) {
|
||||||
throw new InvalidArgumentException('The writer cannot serialize values of type: '.gettype($value));
|
throw new \InvalidArgumentException('The writer cannot serialize values of type: '.gettype($value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ class Service
|
||||||
* The writer may use this if you attempt to serialize an object with a
|
* The writer may use this if you attempt to serialize an object with a
|
||||||
* class that does not implement XmlSerializable.
|
* class that does not implement XmlSerializable.
|
||||||
*
|
*
|
||||||
* Instead it will look at this classmap to see if there is a custom
|
* Instead, it will look at this classmap to see if there is a custom
|
||||||
* serializer here. This is useful if you don't want your value objects
|
* serializer here. This is useful if you don't want your value objects
|
||||||
* to be responsible for serializing themselves.
|
* to be responsible for serializing themselves.
|
||||||
*
|
*
|
||||||
|
|
@ -103,9 +103,9 @@ class Service
|
||||||
*
|
*
|
||||||
* @param string|resource $input
|
* @param string|resource $input
|
||||||
*
|
*
|
||||||
* @throws ParseException
|
|
||||||
*
|
|
||||||
* @return array<string, mixed>|object|string
|
* @return array<string, mixed>|object|string
|
||||||
|
*
|
||||||
|
* @throws ParseException
|
||||||
*/
|
*/
|
||||||
public function parse($input, string $contextUri = null, string &$rootElementName = null)
|
public function parse($input, string $contextUri = null, string &$rootElementName = null)
|
||||||
{
|
{
|
||||||
|
|
@ -147,9 +147,9 @@ class Service
|
||||||
* @param string|string[] $rootElementName
|
* @param string|string[] $rootElementName
|
||||||
* @param string|resource $input
|
* @param string|resource $input
|
||||||
*
|
*
|
||||||
* @throws ParseException
|
|
||||||
*
|
|
||||||
* @return array<string, mixed>|object|string
|
* @return array<string, mixed>|object|string
|
||||||
|
*
|
||||||
|
* @throws ParseException
|
||||||
*/
|
*/
|
||||||
public function expect($rootElementName, $input, string $contextUri = null)
|
public function expect($rootElementName, $input, string $contextUri = null)
|
||||||
{
|
{
|
||||||
|
|
@ -198,7 +198,7 @@ class Service
|
||||||
* This allows an implementor to easily create URI's relative to the root
|
* This allows an implementor to easily create URI's relative to the root
|
||||||
* of the domain.
|
* of the domain.
|
||||||
*
|
*
|
||||||
* @param string|array<string, mixed>|object|XmlSerializable $value
|
* @param string|array<int|string, mixed>|object|XmlSerializable $value
|
||||||
*/
|
*/
|
||||||
public function write(string $rootElementName, $value, string $contextUri = null): string
|
public function write(string $rootElementName, $value, string $contextUri = null): string
|
||||||
{
|
{
|
||||||
|
|
@ -241,6 +241,7 @@ class Service
|
||||||
public function mapValueObject(string $elementName, string $className): void
|
public function mapValueObject(string $elementName, string $className): void
|
||||||
{
|
{
|
||||||
list($namespace) = self::parseClarkNotation($elementName);
|
list($namespace) = self::parseClarkNotation($elementName);
|
||||||
|
$namespace = $namespace ?? '';
|
||||||
|
|
||||||
require_once __DIR__ . '/Deserializer/functions.php';
|
require_once __DIR__ . '/Deserializer/functions.php';
|
||||||
$this->elementMap[$elementName] = function (Reader $reader) use ($className, $namespace) {
|
$this->elementMap[$elementName] = function (Reader $reader) use ($className, $namespace) {
|
||||||
|
|
@ -262,7 +263,7 @@ class Service
|
||||||
* The ValueObject must have been previously registered using
|
* The ValueObject must have been previously registered using
|
||||||
* mapValueObject().
|
* mapValueObject().
|
||||||
*
|
*
|
||||||
*@throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function writeValueObject(object $object, string $contextUri = null): string
|
public function writeValueObject(object $object, string $contextUri = null): string
|
||||||
{
|
{
|
||||||
|
|
@ -283,9 +284,9 @@ class Service
|
||||||
*
|
*
|
||||||
* If the string was invalid, it will throw an InvalidArgumentException.
|
* If the string was invalid, it will throw an InvalidArgumentException.
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
|
||||||
*
|
|
||||||
* @return array{string|null, string}
|
* @return array{string|null, string}
|
||||||
|
*
|
||||||
|
* @throws \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public static function parseClarkNotation(string $str): array
|
public static function parseClarkNotation(string $str): array
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -16,5 +16,5 @@ class Version
|
||||||
/**
|
/**
|
||||||
* Full version number.
|
* Full version number.
|
||||||
*/
|
*/
|
||||||
public const VERSION = '3.0.0';
|
public const VERSION = '4.0.4';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ use XMLWriter;
|
||||||
* @author Evert Pot (http://evertpot.com/)
|
* @author Evert Pot (http://evertpot.com/)
|
||||||
* @license http://sabre.io/license/ Modified BSD License
|
* @license http://sabre.io/license/ Modified BSD License
|
||||||
*/
|
*/
|
||||||
class Writer extends XMLWriter
|
class Writer extends \XMLWriter
|
||||||
{
|
{
|
||||||
use ContextStackTrait;
|
use ContextStackTrait;
|
||||||
|
|
||||||
|
|
@ -92,7 +92,7 @@ class Writer extends XMLWriter
|
||||||
* ]
|
* ]
|
||||||
* ]
|
* ]
|
||||||
*
|
*
|
||||||
* @param mixed $value
|
* @param mixed $value PHP value to be written
|
||||||
*/
|
*/
|
||||||
public function write($value): void
|
public function write($value): void
|
||||||
{
|
{
|
||||||
|
|
@ -125,6 +125,7 @@ class Writer extends XMLWriter
|
||||||
if ('{' === $name[0]) {
|
if ('{' === $name[0]) {
|
||||||
list($namespace, $localName) =
|
list($namespace, $localName) =
|
||||||
Service::parseClarkNotation($name);
|
Service::parseClarkNotation($name);
|
||||||
|
$namespace = $namespace ?? '';
|
||||||
|
|
||||||
if (array_key_exists($namespace, $this->namespaceMap)) {
|
if (array_key_exists($namespace, $this->namespaceMap)) {
|
||||||
$result = $this->startElementNS(
|
$result = $this->startElementNS(
|
||||||
|
|
@ -135,7 +136,7 @@ class Writer extends XMLWriter
|
||||||
} else {
|
} else {
|
||||||
// An empty namespace means it's the global namespace. This is
|
// An empty namespace means it's the global namespace. This is
|
||||||
// allowed, but it mustn't get a prefix.
|
// allowed, but it mustn't get a prefix.
|
||||||
if ('' === $namespace || null === $namespace) {
|
if ('' === $namespace) {
|
||||||
$result = $this->startElement($localName);
|
$result = $this->startElement($localName);
|
||||||
$this->writeAttribute('xmlns', '');
|
$this->writeAttribute('xmlns', '');
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -239,6 +240,7 @@ class Writer extends XMLWriter
|
||||||
$localName
|
$localName
|
||||||
) = Service::parseClarkNotation($name);
|
) = Service::parseClarkNotation($name);
|
||||||
|
|
||||||
|
$namespace = $namespace ?? '';
|
||||||
if (array_key_exists($namespace, $this->namespaceMap)) {
|
if (array_key_exists($namespace, $this->namespaceMap)) {
|
||||||
// It's an attribute with a namespace we know
|
// It's an attribute with a namespace we know
|
||||||
return $this->writeAttribute(
|
return $this->writeAttribute(
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ interface XmlDeserializable
|
||||||
* $reader->parseInnerTree() will parse the entire sub-tree, and advance to
|
* $reader->parseInnerTree() will parse the entire sub-tree, and advance to
|
||||||
* the next element.
|
* the next element.
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed see comments above
|
||||||
*/
|
*/
|
||||||
public static function xmlDeserialize(Reader $reader);
|
public static function xmlDeserialize(Reader $reader);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue