From: gggeek Date: Mon, 25 May 2015 19:39:33 +0000 (+0100) Subject: Fix bugs found by Scrutinizer X-Git-Tag: 4.0.0-alpha^2~31 X-Git-Url: http://git.onelab.eu/?p=plcapi.git;a=commitdiff_plain;h=5a6fe2c4be2af29d295b5756483bffa7f74193f6 Fix bugs found by Scrutinizer --- diff --git a/demo/client/proxy.php b/demo/client/proxy.php index 6d0d3c5..7173db0 100644 --- a/demo/client/proxy.php +++ b/demo/client/proxy.php @@ -45,7 +45,7 @@ class PhpXmlRpcProxy $resp = $this->client->send(new PhpXmlRpc\Request($this->prefix.$name, $valueArray)); if ($resp->faultCode()) { - throw new Exception($resp->faultMessage(), $resp->faultCode); + throw new Exception($resp->faultString(), $resp->faultCode()); } else { return $resp->value(); } diff --git a/demo/vardemo.php b/demo/vardemo.php index bb69756..b1ab3c0 100644 --- a/demo/vardemo.php +++ b/demo/vardemo.php @@ -84,7 +84,7 @@ print "Or in UTC, that is " . PhpXmlRpc\Helper\Date::iso8601Encode($t, 1) . "\n" $tb = PhpXmlRpc\Helper\Date::iso8601Decode($date); print "That is to say $date --> $tb\n"; print "Which comes out at " . PhpXmlRpc\Helper\Date::iso8601Encode($tb) . "\n"; -print "Which was the time in UTC at " . PhpXmlRpc\Helper\Date::iso8601Eecode($date, 1) . "\n"; +print "Which was the time in UTC at " . PhpXmlRpc\Helper\Date::iso8601Encode($date, 1) . "\n"; print "\n"; diff --git a/src/Client.php b/src/Client.php index 21060e8..c0d86c3 100644 --- a/src/Client.php +++ b/src/Client.php @@ -341,7 +341,7 @@ class Client * @param integer $timeout Connection timeout, in seconds, If unspecified, a platform specific timeout will apply * @param string $method if left unspecified, the http protocol chosen during creation of the object will be used * - * @return Response + * @return Response|Response[] */ public function send($req, $timeout = 0, $method = '') { diff --git a/src/Response.php b/src/Response.php index 6ed243a..7e2ebb6 100644 --- a/src/Response.php +++ b/src/Response.php @@ -75,7 +75,7 @@ class Response /** * Returns the value received by the server. * - * @return mixed the xmlrpc value object returned by the server. Might be an xml string or php value if the response has been created by specially configured Client objects + * @return Value|string|mixed the xmlrpc value object returned by the server. Might be an xml string or php value if the response has been created by specially configured Client objects */ public function value() { diff --git a/src/Server.php b/src/Server.php index d8e591d..089efdf 100644 --- a/src/Server.php +++ b/src/Server.php @@ -966,7 +966,7 @@ class Server $pt = array(); $wrapper = new Wrapper(); foreach ($call['params'] as $val) { - $pt[] = $wrapper->php_2_xmlrpc_type(gettype($val)); + $pt[] = $wrapper->php2XmlrpcType(gettype($val)); } $result = $server->execute($call['methodName'], $call['params'], $pt);