X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2FEncoder.php;h=ebf3060d4996160c753b6b5d1cf2229eaa73688d;hb=7fbd194478e080d624bab075d189bf3ba215325d;hp=495584db3614cece94ca191de2b444ae6d8eec8b;hpb=7df27d0ac7a41e6ca108ff85d6bfd379251dfc78;p=plcapi.git diff --git a/src/Encoder.php b/src/Encoder.php index 495584d..ebf3060 100644 --- a/src/Encoder.php +++ b/src/Encoder.php @@ -6,6 +6,7 @@ use PhpXmlRpc\Helper\XMLParser; /** * A helper class to easily convert between Value objects and php native values + * @todo implement an interface */ class Encoder { @@ -213,8 +214,7 @@ class Encoder // catch "user function", "unknown type" default: // giancarlo pinerolo - // it has to return - // an empty object in case, not a boolean. + // it has to return an empty object in case, not a boolean. $xmlrpcVal = new Value(); break; } @@ -226,6 +226,8 @@ class Encoder * Convert the xml representation of a method response, method request or single * xmlrpc value into the appropriate object (a.k.a. deserialize). * + * Q: is this a good name for this method? It does something quite different from 'decode' after all (returning objects vs returns plain php values)... + * * @param string $xmlVal * @param array $options * @@ -290,9 +292,11 @@ class Encoder } switch ($xmlRpcParser->_xh['rt']) { case 'methodresponse': - $v = &$xmlRpcParser->_xh['value']; + $v = $xmlRpcParser->_xh['value']; if ($xmlRpcParser->_xh['isf'] == 1) { + /** @var Value $vc */ $vc = $v['faultCode']; + /** @var Value $vs */ $vs = $v['faultString']; $r = new Response(0, $vc->scalarval(), $vs->scalarval()); } else {