Explorar o código

Exception message on boolean type

Asmir Mustafic %!s(int64=11) %!d(string=hai) anos
pai
achega
24f46019f5
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/JMS/Serializer/XmlDeserializationVisitor.php

+ 1 - 1
src/JMS/Serializer/XmlDeserializationVisitor.php

@@ -109,7 +109,7 @@ class XmlDeserializationVisitor extends AbstractVisitor
         } elseif ('false' === $data || '0' === $data) {
             $data = false;
         } 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", "false", "1" or "0", but got %s.', json_encode($data)));
         }
 
         if (null === $this->result) {