Fix bugs found by Scrutinizer
authorgggeek <giunta.gaetano@gmail.com>
Mon, 25 May 2015 19:39:33 +0000 (20:39 +0100)
committergggeek <giunta.gaetano@gmail.com>
Mon, 25 May 2015 19:39:33 +0000 (20:39 +0100)
demo/client/proxy.php
demo/vardemo.php
src/Client.php
src/Response.php
src/Server.php

index 6d0d3c5..7173db0 100644 (file)
@@ -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();
         }
index bb69756..b1ab3c0 100644 (file)
@@ -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 "</pre>\n";
 
index 21060e8..c0d86c3 100644 (file)
@@ -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 = '')
     {
index 6ed243a..7e2ebb6 100644 (file)
@@ -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()
     {
index d8e591d..089efdf 100644 (file)
@@ -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);