Passed
Push — master ( b73d50...e8d99c )
by Gaetano
07:04
created
lib/xmlrpc_wrappers.inc 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -141,9 +141,9 @@
 block discarded – undo
141 141
  * @deprecated
142 142
  */
143 143
 function build_remote_method_wrapper_code($client, $methodName, $xmlrpcFuncName,
144
-     $mSig, $mDesc = '', $timeout = 0, $protocol = '', $clientCopyMode = 0, $prefix = 'xmlrpc',
145
-     $decodePhpObjects = false, $encodePhpObjects = false, $decodeFault = false,
146
-     $faultResponse = '', $namespace = '\\PhpXmlRpc\\')
144
+        $mSig, $mDesc = '', $timeout = 0, $protocol = '', $clientCopyMode = 0, $prefix = 'xmlrpc',
145
+        $decodePhpObjects = false, $encodePhpObjects = false, $decodeFault = false,
146
+        $faultResponse = '', $namespace = '\\PhpXmlRpc\\')
147 147
 {
148 148
     $code = "function $xmlrpcFuncName (";
149 149
     if ($clientCopyMode < 2) {
Please login to merge, or discard this patch.
src/Helper/Charset.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -176,8 +176,7 @@
 block discarded – undo
176 176
                         } else {
177 177
                             $escapedData .= $ch;
178 178
                         }
179
-                    }
180
-                    else if ($ii < 128) {
179
+                    } else if ($ii < 128) {
181 180
                         /// @todo shall we replace this with a (supposedly) faster str_replace?
182 181
                         /// @todo to be 'print safe', should we encode as well character 127 (DEL) ?
183 182
                         switch ($ii) {
Please login to merge, or discard this patch.
demo/server/methodProviders/wrapper.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
  */
27 27
 function plain_findstate($stateNo)
28 28
 {
29
-     if (isset(exampleMethods::$stateNames[$stateNo - 1])) {
29
+        if (isset(exampleMethods::$stateNames[$stateNo - 1])) {
30 30
         return exampleMethods::$stateNames[$stateNo - 1];
31 31
     } else {
32 32
         // not, there so complain
Please login to merge, or discard this patch.
src/Wrapper.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -605,8 +605,9 @@
 block discarded – undo
605 605
         }
606 606
         foreach ($parsVariations as $i => $pars) {
607 607
             $innerCode .= "  if (\$paramCount == " . count($pars) . ") \$retVal = {$catchWarnings}$realFuncName(" . implode(',', $pars) . ");\n";
608
-            if ($i < (count($parsVariations) - 1))
609
-                $innerCode .= "  else\n";
608
+            if ($i < (count($parsVariations) - 1)) {
609
+                            $innerCode .= "  else\n";
610
+            }
610 611
         }
611 612
         $innerCode .= "  if (is_a(\$retVal, '" . static::$namespace . "Response'))\n    return \$retVal;\n  else\n";
612 613
         /// q: why not do the same for int, float, bool, string?
Please login to merge, or discard this patch.
src/Client.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2011,9 +2011,9 @@
 block discarded – undo
2011 2011
      * @return false|\CurlHandle|resource
2012 2012
      */
2013 2013
     protected function prepareCurlHandle($req, $server, $port, $timeout = 0, $username = '', $password = '',
2014
-         $authType = 1, $cert = '', $certPass = '', $caCert = '', $caCertDir = '', $proxyHost = '', $proxyPort = 0,
2015
-         $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, $method = 'https', $keepAlive = false, $key = '',
2016
-         $keyPass = '', $sslVersion = 0)
2014
+            $authType = 1, $cert = '', $certPass = '', $caCert = '', $caCertDir = '', $proxyHost = '', $proxyPort = 0,
2015
+            $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, $method = 'https', $keepAlive = false, $key = '',
2016
+            $keyPass = '', $sslVersion = 0)
2017 2017
     {
2018 2018
         $this->logDeprecationUnlessCalledBy('sendViaCURL');
2019 2019
 
Please login to merge, or discard this patch.
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1276,19 +1276,25 @@  discard block
 block discarded – undo
1276 1276
             $this->errstr = 'no response';
1277 1277
             $resp = new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'] .
1278 1278
                 ': ' . curl_error($curl));
1279
-            if (PHP_MAJOR_VERSION < 8) curl_close($curl);
1279
+            if (PHP_MAJOR_VERSION < 8) {
1280
+                curl_close($curl);
1281
+            }
1280 1282
             if ($opts['keepalive']) {
1281 1283
                 $this->xmlrpc_curl_handle = null;
1282 1284
             }
1283 1285
         } else {
1284 1286
             if (!$opts['keepalive']) {
1285
-                if (PHP_MAJOR_VERSION < 8) curl_close($curl);
1287
+                if (PHP_MAJOR_VERSION < 8) {
1288
+                    curl_close($curl);
1289
+                }
1286 1290
             }
1287 1291
             $resp = $req->parseResponse($result, true, $opts['return_type']);
1288 1292
             if ($opts['keepalive']) {
1289 1293
                 /// @todo if we got back a 302 or 308, we should not reuse the curl handle for later calls
1290 1294
                 if (is_object($resp) && $resp->faultCode() == PhpXmlRpc::$xmlrpcerr['http_error']) {
1291
-                    if (PHP_MAJOR_VERSION < 8) curl_close($curl);
1295
+                    if (PHP_MAJOR_VERSION < 8) {
1296
+                        curl_close($curl);
1297
+                    }
1292 1298
                     $this->xmlrpc_curl_handle = null;
1293 1299
                 }
1294 1300
             }
@@ -1447,7 +1453,9 @@  discard block
 block discarded – undo
1447 1453
                     curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE);
1448 1454
                 } else {
1449 1455
                     $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. HTTP2 is not supported by the current PHP/curl install');
1450
-                    if (PHP_MAJOR_VERSION < 8) curl_close($curl);
1456
+                    if (PHP_MAJOR_VERSION < 8) {
1457
+                        curl_close($curl);
1458
+                    }
1451 1459
                     return false;
1452 1460
                 }
1453 1461
                 break;
@@ -1462,7 +1470,9 @@  discard block
 block discarded – undo
1462 1470
                 curl_setopt($curl, CURLOPT_HTTPAUTH, $opts['authtype']);
1463 1471
             } elseif ($opts['authtype'] != 1) {
1464 1472
                 $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth is supported by the current PHP/curl install');
1465
-                if (PHP_MAJOR_VERSION < 8) curl_close($curl);
1473
+                if (PHP_MAJOR_VERSION < 8) {
1474
+                    curl_close($curl);
1475
+                }
1466 1476
                 return false;
1467 1477
             }
1468 1478
         }
@@ -1513,7 +1523,9 @@  discard block
 block discarded – undo
1513 1523
                     curl_setopt($curl, CURLOPT_PROXYAUTH, $opts['proxy_authtype']);
1514 1524
                 } elseif ($opts['proxy_authtype'] != 1) {
1515 1525
                     $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth to proxy is supported by the current PHP/curl install');
1516
-                    if (PHP_MAJOR_VERSION < 8) curl_close($curl);
1526
+                    if (PHP_MAJOR_VERSION < 8) {
1527
+                        curl_close($curl);
1528
+                    }
1517 1529
                     return false;
1518 1530
                 }
1519 1531
             }
Please login to merge, or discard this patch.
src/Server.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -463,7 +463,7 @@
 block discarded – undo
463 463
     public function addToMap($methodName, $function, $sig = null, $doc = false, $sigDoc = false, $parametersType = false,
464 464
         $exceptionHandling = false)
465 465
     {
466
-       $this->add_to_map($methodName, $function, $sig, $doc, $sigDoc, $parametersType, $exceptionHandling);
466
+        $this->add_to_map($methodName, $function, $sig, $doc, $sigDoc, $parametersType, $exceptionHandling);
467 467
     }
468 468
 
469 469
     /**
Please login to merge, or discard this patch.
demo/server/methodProviders/testsuite.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -88,11 +88,12 @@
 block discarded – undo
88 88
     $a = $req->getParam(0);
89 89
     $b = $req->getParam(1);
90 90
 
91
-    if ($a->scalarTyp() == Value::$xmlrpcNull)
92
-        return new Response(new Value(plain_findstate($b->scalarVal())));
93
-    else
94
-        return new Response(new Value(plain_findstate($a->scalarVal())));
95
-}
91
+    if ($a->scalarTyp() == Value::$xmlrpcNull) {
92
+            return new Response(new Value(plain_findstate($b->scalarVal())));
93
+    } else {
94
+            return new Response(new Value(plain_findstate($a->scalarVal())));
95
+    }
96
+    }
96 97
 
97 98
 $sleep_sig = array(array(Value::$xmlrpcInt, Value::$xmlrpcInt));
98 99
 $sleep_doc = 'Sleeps for the requested number of seconds (between 1 and 60), before sending back the response';
Please login to merge, or discard this patch.
tests/09HTTPTest.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -304,8 +304,7 @@  discard block
 block discarded – undo
304 304
         if (!function_exists('curl_init'))
305 305
         {
306 306
             $this->markTestSkipped('CURL missing: cannot test https functionality');
307
-        }
308
-        else if ($this->args['HTTPSSERVER'] == '')
307
+        } else if ($this->args['HTTPSSERVER'] == '')
309 308
         {
310 309
             $this->markTestSkipped('HTTPS SERVER definition missing: cannot test https');
311 310
         }
@@ -480,8 +479,7 @@  discard block
 block discarded – undo
480 479
         if (!function_exists('curl_init'))
481 480
         {
482 481
             $this->markTestSkipped('CURL missing: cannot test http 1.1 w. proxy');
483
-        }
484
-        else if ($this->args['PROXYSERVER'] == '')
482
+        } else if ($this->args['PROXYSERVER'] == '')
485 483
         {
486 484
             $this->markTestSkipped('PROXYSERVER definition missing: cannot test proxy w. http 1.1');
487 485
         }
@@ -505,12 +503,10 @@  discard block
 block discarded – undo
505 503
         if (!function_exists('curl_init'))
506 504
         {
507 505
             $this->markTestSkipped('CURL missing: cannot test https w. proxy');
508
-        }
509
-        else if ($this->args['PROXYSERVER'] == '')
506
+        } else if ($this->args['PROXYSERVER'] == '')
510 507
         {
511 508
             $this->markTestSkipped('PROXYSERVER definition missing: cannot test proxy w. https');
512
-        }
513
-        else if ($this->args['HTTPSSERVER'] == '')
509
+        } else if ($this->args['HTTPSSERVER'] == '')
514 510
         {
515 511
             $this->markTestSkipped('HTTPS SERVER definition missing: cannot test https w. proxy');
516 512
         }
Please login to merge, or discard this patch.
src/Helper/XMLParser.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -272,19 +272,25 @@
 block discarded – undo
272 272
             }
273 273
         /// @todo bump minimum php version to 5.5 and use a finally clause instead of doing cleanup 3 times
274 274
         } catch (\Exception $e) {
275
-            if (PHP_MAJOR_VERSION < 8) xml_parser_free($parser);
275
+            if (PHP_MAJOR_VERSION < 8) {
276
+                xml_parser_free($parser);
277
+            }
276 278
             $this->current_parsing_options = array();
277 279
             /// @todo should we set $this->_xh['isf'] and $this->_xh['isf_reason'] ?
278 280
             throw $e;
279 281
         } catch (\Error $e) {
280
-            if (PHP_MAJOR_VERSION < 8) xml_parser_free($parser);
282
+            if (PHP_MAJOR_VERSION < 8) {
283
+                xml_parser_free($parser);
284
+            }
281 285
             $this->current_parsing_options = array();
282 286
             //$this->accept = $prevAccept;
283 287
             /// @todo should we set $this->_xh['isf'] and $this->_xh['isf_reason'] ?
284 288
             throw $e;
285 289
         }
286 290
 
287
-        if (PHP_MAJOR_VERSION < 8) xml_parser_free($parser);
291
+        if (PHP_MAJOR_VERSION < 8) {
292
+            xml_parser_free($parser);
293
+        }
288 294
         $this->current_parsing_options = array();
289 295
 
290 296
         // BC
Please login to merge, or discard this patch.