|
@@ -104,9 +104,9 @@ class XmlDeserializationVisitor extends AbstractVisitor
|
|
{
|
|
{
|
|
$data = (string) $data;
|
|
$data = (string) $data;
|
|
|
|
|
|
- if ('true' === $data) {
|
|
|
|
|
|
+ if ('true' === $data || '1' === $data) {
|
|
$data = true;
|
|
$data = true;
|
|
- } elseif ('false' === $data) {
|
|
|
|
|
|
+ } elseif ('false' === $data || '0' === $data) {
|
|
$data = false;
|
|
$data = false;
|
|
} else {
|
|
} else {
|
|
throw new RuntimeException(sprintf('Could not convert data to boolean. Expected "true", or "false", but got %s.', json_encode($data)));
|
|
throw new RuntimeException(sprintf('Could not convert data to boolean. Expected "true", or "false", but got %s.', json_encode($data)));
|
|
@@ -224,9 +224,9 @@ class XmlDeserializationVisitor extends AbstractVisitor
|
|
$nodes = $data->xpath('./@'.$attributeName);
|
|
$nodes = $data->xpath('./@'.$attributeName);
|
|
if (!empty($nodes)) {
|
|
if (!empty($nodes)) {
|
|
$v = (string) reset($nodes);
|
|
$v = (string) reset($nodes);
|
|
- $metadata->reflection->setValue($this->currentObject, $v);
|
|
|
|
|
|
+ $metadata->reflection->setValue($this->currentObject, $v);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
} elseif (isset($data[$name])) {
|
|
} elseif (isset($data[$name])) {
|
|
$v = $this->navigator->accept($data[$name], $metadata->type, $context);
|
|
$v = $this->navigator->accept($data[$name], $metadata->type, $context);
|
|
$metadata->reflection->setValue($this->currentObject, $v);
|
|
$metadata->reflection->setValue($this->currentObject, $v);
|