nitpicks
authorgggeek <giunta.gaetano@gmail.com>
Fri, 25 Nov 2022 16:41:18 +0000 (16:41 +0000)
committergggeek <giunta.gaetano@gmail.com>
Fri, 25 Nov 2022 16:41:18 +0000 (16:41 +0000)
NEWS
lib/xmlrpc_wrappers.inc
tests/1ValueTest.php

diff --git a/NEWS b/NEWS
index 9e069be..71541cb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,8 @@ XML-RPC for PHP version xxx - unreleased
 
 * fixed: DateTimeInterface is not present in php 5.4 (error introduced in ver. 4.8.1)
 
+* fixed: use of uninitialized var when accessing nonexisting member of legacy class `xmlrpc_server` - thanks SonarQube
+
 * new: allow users of the library to get more fine-grained information about errors in parsing received responses by
   overriding the integer value of `PhpXmlRpc::$xmlrpcerr['invalid_xml']`, `PhpXmlRpc::$xmlrpcerr['xml_not_compliant']`,
   `PhpXmlRpc::$xmlrpcerr['xml_parsing_error']` and the equivalent `PhpXmlRpc::$xmlrpcstr` strings (feature req. #101)
index 4331c36..04c993e 100644 (file)
@@ -150,7 +150,7 @@ function build_remote_method_wrapper_code($client, $methodName, $xmlrpcFuncName,
     $code = "function $xmlrpcFuncName (";
     if ($clientCopyMode < 2) {
         // client copy mode 0 or 1 == partial / full client copy in emitted code
-        $innerCode = build_client_wrapper_code($client, $clientCopyMode, $prefix, $namespace);
+        $innerCode = build_client_wrapper_code($client, $clientCopyMode, $prefix);
         $innerCode .= "\$client->setDebug(\$debug);\n";
         $this_ = '';
     } else {
@@ -229,9 +229,9 @@ function build_client_wrapper_code($client, $verbatim_client_copy, $prefix='xmlr
     // (this provides for future expansion or subclassing of client obj)
     if ($verbatim_client_copy)
     {
-        foreach($client as $fld => $val)
+        foreach ($client as $fld => $val)
         {
-            if($fld != 'debug' && $fld != 'return_type')
+            if ($fld != 'debug' && $fld != 'return_type')
             {
                 $val = var_export($val, true);
                 $code .= "\$client->$fld = $val;\n";
index 67b53a2..ad8adb6 100644 (file)
@@ -163,7 +163,7 @@ class ValueTests extends PhpXmlRpc_PolyfillTestCase
     }
 
     /// @todo do not use \PhpXmlRpc\Encoder for this test
-    function testBigXML()
+    public function testBigXML()
     {
         // nb: make sure that  the serialized xml corresponding to this is > 10MB in size
         $data = array();