Passed
Push — master ( 6f0f8c...d68788 )
by Gaetano
06:26
created
src/Client.php 1 patch
Spacing   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -354,10 +354,10 @@  discard block
 block discarded – undo
354 354
             $server = $parts['host'];
355 355
             $path = isset($parts['path']) ? $parts['path'] : '';
356 356
             if (isset($parts['query'])) {
357
-                $path .= '?' . $parts['query'];
357
+                $path .= '?'.$parts['query'];
358 358
             }
359 359
             if (isset($parts['fragment'])) {
360
-                $path .= '#' . $parts['fragment'];
360
+                $path .= '#'.$parts['fragment'];
361 361
             }
362 362
             if (isset($parts['port'])) {
363 363
                 $port = $parts['port'];
@@ -373,7 +373,7 @@  discard block
 block discarded – undo
373 373
             }
374 374
         }
375 375
         if ($path == '' || $path[0] != '/') {
376
-            $this->path = '/' . $path;
376
+            $this->path = '/'.$path;
377 377
         } else {
378 378
             $this->path = $path;
379 379
         }
@@ -405,7 +405,7 @@  discard block
 block discarded – undo
405 405
         //$this->accepted_charset_encodings = $ch->knownCharsets();
406 406
 
407 407
         // initialize user_agent string
408
-        $this->user_agent = PhpXmlRpc::$xmlrpcName . ' ' . PhpXmlRpc::$xmlrpcVersion;
408
+        $this->user_agent = PhpXmlRpc::$xmlrpcName.' '.PhpXmlRpc::$xmlrpcVersion;
409 409
     }
410 410
 
411 411
     /**
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
     public function getOptions()
595 595
     {
596 596
         $values = array();
597
-        foreach($this->options as $opt) {
597
+        foreach ($this->options as $opt) {
598 598
             $values[$opt] = $this->getOption($opt);
599 599
         }
600 600
         return $values;
@@ -607,7 +607,7 @@  discard block
 block discarded – undo
607 607
      */
608 608
     public function setOptions($options)
609 609
     {
610
-        foreach($options as $name => $value) {
610
+        foreach ($options as $name => $value) {
611 611
             $this->setOption($name, $value);
612 612
         }
613 613
 
@@ -903,12 +903,12 @@  discard block
 block discarded – undo
903 903
      */
904 904
     public function getUrl()
905 905
     {
906
-        $url = $this->method . '://' . $this->server;
906
+        $url = $this->method.'://'.$this->server;
907 907
         if (($this->port = 80 && in_array($this->method, array('http', 'http10', 'http11', 'h2c'))) &&
908 908
             ($this->port = 443 && in_array($this->method, array('https', 'h2')))) {
909
-            return $url . $this->path;
909
+            return $url.$this->path;
910 910
         } else {
911
-            return $url . ':' . $this->port . $this->path;
911
+            return $url.':'.$this->port.$this->path;
912 912
         }
913 913
     }
914 914
 
@@ -1053,7 +1053,7 @@  discard block
 block discarded – undo
1053 1053
      */
1054 1054
     protected function sendPayloadHTTP10($req, $server, $port, $timeout = 0, $username = '', $password = '',
1055 1055
         $authType = 1, $proxyHost = '', $proxyPort = 0, $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1,
1056
-        $method='http')
1056
+        $method = 'http')
1057 1057
     {
1058 1058
         //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED);
1059 1059
 
@@ -1086,7 +1086,7 @@  discard block
 block discarded – undo
1086 1086
      * @param int $sslVersion
1087 1087
      * @return Response
1088 1088
      */
1089
-    protected function sendPayloadHTTPS($req, $server, $port, $timeout = 0, $username = '',  $password = '',
1089
+    protected function sendPayloadHTTPS($req, $server, $port, $timeout = 0, $username = '', $password = '',
1090 1090
         $authType = 1, $cert = '', $certPass = '', $caCert = '', $caCertDir = '', $proxyHost = '', $proxyPort = 0,
1091 1091
         $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, $keepAlive = false, $key = '', $keyPass = '',
1092 1092
         $sslVersion = 0)
@@ -1125,7 +1125,7 @@  discard block
 block discarded – undo
1125 1125
      */
1126 1126
     protected function sendPayloadSocket($req, $server, $port, $timeout = 0, $username = '', $password = '',
1127 1127
         $authType = 1, $cert = '', $certPass = '', $caCert = '', $caCertDir = '', $proxyHost = '', $proxyPort = 0,
1128
-        $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, $method='http', $key = '', $keyPass = '',
1128
+        $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, $method = 'http', $key = '', $keyPass = '',
1129 1129
         $sslVersion = 0)
1130 1130
     {
1131 1131
         /// @todo log a warning if passed an unsupported method
@@ -1158,16 +1158,16 @@  discard block
 block discarded – undo
1158 1158
         // thanks to Grant Rauscher <[email protected]> for this
1159 1159
         $credentials = '';
1160 1160
         if ($username != '') {
1161
-            $credentials = 'Authorization: Basic ' . base64_encode($username . ':' . $password) . "\r\n";
1161
+            $credentials = 'Authorization: Basic '.base64_encode($username.':'.$password)."\r\n";
1162 1162
             if ($authType != 1) {
1163 1163
                 /// @todo make this a proper error, i.e. return a failure
1164
-                $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth is supported with HTTP 1.0');
1164
+                $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. Only Basic auth is supported with HTTP 1.0');
1165 1165
             }
1166 1166
         }
1167 1167
 
1168 1168
         $acceptedEncoding = '';
1169 1169
         if (is_array($this->accepted_compression) && count($this->accepted_compression)) {
1170
-            $acceptedEncoding = 'Accept-Encoding: ' . implode(', ', $this->accepted_compression) . "\r\n";
1170
+            $acceptedEncoding = 'Accept-Encoding: '.implode(', ', $this->accepted_compression)."\r\n";
1171 1171
         }
1172 1172
 
1173 1173
         if ($port == 0) {
@@ -1183,13 +1183,13 @@  discard block
 block discarded – undo
1183 1183
             $connectPort = $proxyPort;
1184 1184
             $transport = 'tcp';
1185 1185
             /// @todo check: should we not use https in some cases?
1186
-            $uri = 'http://' . $server . ':' . $port . $this->path;
1186
+            $uri = 'http://'.$server.':'.$port.$this->path;
1187 1187
             if ($proxyUsername != '') {
1188 1188
                 if ($proxyAuthType != 1) {
1189 1189
                     /// @todo make this a proper error, i.e. return a failure
1190
-                    $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth to proxy is supported with HTTP 1.0');
1190
+                    $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. Only Basic auth to proxy is supported with HTTP 1.0');
1191 1191
                 }
1192
-                $proxyCredentials = 'Proxy-Authorization: Basic ' . base64_encode($proxyUsername . ':' . $proxyPassword) . "\r\n";
1192
+                $proxyCredentials = 'Proxy-Authorization: Basic '.base64_encode($proxyUsername.':'.$proxyPassword)."\r\n";
1193 1193
             }
1194 1194
         } else {
1195 1195
             $connectServer = $server;
@@ -1204,32 +1204,32 @@  discard block
 block discarded – undo
1204 1204
             $version = '';
1205 1205
             foreach ($this->cookies as $name => $cookie) {
1206 1206
                 /// @todo should we sanitize the cookie name/value on behalf of the user?
1207
-                $cookieHeader .= ' ' . $name . '=' . $cookie['value'] . ";";
1207
+                $cookieHeader .= ' '.$name.'='.$cookie['value'].";";
1208 1208
             }
1209
-            $cookieHeader = 'Cookie:' . $version . substr($cookieHeader, 0, -1) . "\r\n";
1209
+            $cookieHeader = 'Cookie:'.$version.substr($cookieHeader, 0, -1)."\r\n";
1210 1210
         }
1211 1211
 
1212 1212
         // omit port if default
1213 1213
         if (($port == 80 && in_array($method, array('http', 'http10'))) || ($port == 443 && $method == 'https')) {
1214
-            $port =  '';
1214
+            $port = '';
1215 1215
         } else {
1216
-            $port = ':' . $port;
1216
+            $port = ':'.$port;
1217 1217
         }
1218 1218
 
1219
-        $op = 'POST ' . $uri . " HTTP/1.0\r\n" .
1220
-            'User-Agent: ' . $this->user_agent . "\r\n" .
1221
-            'Host: ' . $server . $port . "\r\n" .
1222
-            $credentials .
1223
-            $proxyCredentials .
1224
-            $acceptedEncoding .
1225
-            $encodingHdr .
1226
-            'Accept-Charset: ' . implode(',', $this->accepted_charset_encodings) . "\r\n" .
1227
-            $cookieHeader .
1228
-            'Content-Type: ' . $req->content_type . "\r\nContent-Length: " .
1229
-            strlen($payload) . "\r\n\r\n" .
1219
+        $op = 'POST '.$uri." HTTP/1.0\r\n".
1220
+            'User-Agent: '.$this->user_agent."\r\n".
1221
+            'Host: '.$server.$port."\r\n".
1222
+            $credentials.
1223
+            $proxyCredentials.
1224
+            $acceptedEncoding.
1225
+            $encodingHdr.
1226
+            'Accept-Charset: '.implode(',', $this->accepted_charset_encodings)."\r\n".
1227
+            $cookieHeader.
1228
+            'Content-Type: '.$req->content_type."\r\nContent-Length: ".
1229
+            strlen($payload)."\r\n\r\n".
1230 1230
             $payload;
1231 1231
 
1232
-        if ($this->debug > 1) {
1232
+        if ($this->debug>1) {
1233 1233
             $this->getLogger()->debug("---SENDING---\n$op\n---END---");
1234 1234
         }
1235 1235
 
@@ -1256,7 +1256,7 @@  discard block
 block discarded – undo
1256 1256
 
1257 1257
         $context = stream_context_create($contextOptions);
1258 1258
 
1259
-        if ($timeout <= 0) {
1259
+        if ($timeout<=0) {
1260 1260
             $connectTimeout = ini_get('default_socket_timeout');
1261 1261
         } else {
1262 1262
             $connectTimeout = $timeout;
@@ -1268,7 +1268,7 @@  discard block
 block discarded – undo
1268 1268
         $fp = @stream_socket_client("$transport://$connectServer:$connectPort", $this->errno, $this->errstr, $connectTimeout,
1269 1269
             STREAM_CLIENT_CONNECT, $context);
1270 1270
         if ($fp) {
1271
-            if ($timeout > 0) {
1271
+            if ($timeout>0) {
1272 1272
                 stream_set_timeout($fp, $timeout, 0);
1273 1273
             }
1274 1274
         } else {
@@ -1277,8 +1277,8 @@  discard block
 block discarded – undo
1277 1277
                 $this->errstr = $err['message'];
1278 1278
             }
1279 1279
 
1280
-            $this->errstr = 'Connect error: ' . $this->errstr;
1281
-            $r = new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['http_error'], $this->errstr . ' (' . $this->errno . ')');
1280
+            $this->errstr = 'Connect error: '.$this->errstr;
1281
+            $r = new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['http_error'], $this->errstr.' ('.$this->errno.')');
1282 1282
 
1283 1283
             return $r;
1284 1284
         }
@@ -1366,18 +1366,18 @@  discard block
 block discarded – undo
1366 1366
             $keyPass, $sslVersion);
1367 1367
 
1368 1368
         if (!$curl) {
1369
-            return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'] . ': error during curl initialization. Check php error log for details');
1369
+            return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'].': error during curl initialization. Check php error log for details');
1370 1370
         }
1371 1371
 
1372 1372
         $result = curl_exec($curl);
1373 1373
 
1374
-        if ($this->debug > 1) {
1374
+        if ($this->debug>1) {
1375 1375
             $message = "---CURL INFO---\n";
1376 1376
             foreach (curl_getinfo($curl) as $name => $val) {
1377 1377
                 if (is_array($val)) {
1378 1378
                     $val = implode("\n", $val);
1379 1379
                 }
1380
-                $message .= $name . ': ' . $val . "\n";
1380
+                $message .= $name.': '.$val."\n";
1381 1381
             }
1382 1382
             $message .= '---END---';
1383 1383
             $this->getLogger()->debug($message);
@@ -1387,7 +1387,7 @@  discard block
 block discarded – undo
1387 1387
             /// @todo we should use a better check here - what if we get back '' or '0'?
1388 1388
 
1389 1389
             $this->errstr = 'no response';
1390
-            $resp = new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'] . ': ' . curl_error($curl));
1390
+            $resp = new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'].': '.curl_error($curl));
1391 1391
             curl_close($curl);
1392 1392
             if ($keepAlive) {
1393 1393
                 $this->xmlrpc_curl_handle = null;
@@ -1457,12 +1457,12 @@  discard block
 block discarded – undo
1457 1457
                     // http, https
1458 1458
                     $protocol = $method;
1459 1459
                     if (strpos($protocol, ':') !== false) {
1460
-                        $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ": warning - attempted hacking attempt?. The curl protocol requested for the call is: '$protocol'");
1460
+                        $this->getLogger()->error('XML-RPC: '.__METHOD__.": warning - attempted hacking attempt?. The curl protocol requested for the call is: '$protocol'");
1461 1461
                         return false;
1462 1462
                     }
1463 1463
                 }
1464 1464
             }
1465
-            $curl = curl_init($protocol . '://' . $server . ':' . $port . $this->path);
1465
+            $curl = curl_init($protocol.'://'.$server.':'.$port.$this->path);
1466 1466
             if (!$curl) {
1467 1467
                 return false;
1468 1468
             }
@@ -1476,7 +1476,7 @@  discard block
 block discarded – undo
1476 1476
         // results into variable
1477 1477
         curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
1478 1478
 
1479
-        if ($this->debug > 1) {
1479
+        if ($this->debug>1) {
1480 1480
             curl_setopt($curl, CURLOPT_VERBOSE, true);
1481 1481
             /// @todo redirect curlopt_stderr to some stream which can be piped to the logger
1482 1482
         }
@@ -1501,7 +1501,7 @@  discard block
 block discarded – undo
1501 1501
             }
1502 1502
         }
1503 1503
         // extra headers
1504
-        $headers = array('Content-Type: ' . $req->content_type, 'Accept-Charset: ' . implode(',', $this->accepted_charset_encodings));
1504
+        $headers = array('Content-Type: '.$req->content_type, 'Accept-Charset: '.implode(',', $this->accepted_charset_encodings));
1505 1505
         // if no keepalive is wanted, let the server know it in advance
1506 1506
         if (!$keepAlive) {
1507 1507
             $headers[] = 'Connection: close';
@@ -1518,7 +1518,7 @@  discard block
 block discarded – undo
1518 1518
         curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
1519 1519
         // timeout is borked
1520 1520
         if ($timeout) {
1521
-            curl_setopt($curl, CURLOPT_TIMEOUT, $timeout == 1 ? 1 : $timeout - 1);
1521
+            curl_setopt($curl, CURLOPT_TIMEOUT, $timeout == 1 ? 1 : $timeout-1);
1522 1522
         }
1523 1523
 
1524 1524
         switch ($method) {
@@ -1533,7 +1533,7 @@  discard block
 block discarded – undo
1533 1533
                     curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE);
1534 1534
                 } else {
1535 1535
                     /// @todo make this a proper error, i.e. return a failure
1536
-                    $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. HTTP2 is not supported by the current PHP/curl install');
1536
+                    $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. HTTP2 is not supported by the current PHP/curl install');
1537 1537
                 }
1538 1538
                 break;
1539 1539
             case 'h2':
@@ -1542,12 +1542,12 @@  discard block
 block discarded – undo
1542 1542
         }
1543 1543
 
1544 1544
         if ($username && $password) {
1545
-            curl_setopt($curl, CURLOPT_USERPWD, $username . ':' . $password);
1545
+            curl_setopt($curl, CURLOPT_USERPWD, $username.':'.$password);
1546 1546
             if (defined('CURLOPT_HTTPAUTH')) {
1547 1547
                 curl_setopt($curl, CURLOPT_HTTPAUTH, $authType);
1548 1548
             } elseif ($authType != 1) {
1549 1549
                 /// @todo make this a proper error, i.e. return a failure
1550
-                $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth is supported by the current PHP/curl install');
1550
+                $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. Only Basic auth is supported by the current PHP/curl install');
1551 1551
             }
1552 1552
         }
1553 1553
 
@@ -1590,14 +1590,14 @@  discard block
 block discarded – undo
1590 1590
             if ($proxyPort == 0) {
1591 1591
                 $proxyPort = 8080; // NB: even for HTTPS, local connection is on port 8080
1592 1592
             }
1593
-            curl_setopt($curl, CURLOPT_PROXY, $proxyHost . ':' . $proxyPort);
1593
+            curl_setopt($curl, CURLOPT_PROXY, $proxyHost.':'.$proxyPort);
1594 1594
             if ($proxyUsername) {
1595
-                curl_setopt($curl, CURLOPT_PROXYUSERPWD, $proxyUsername . ':' . $proxyPassword);
1595
+                curl_setopt($curl, CURLOPT_PROXYUSERPWD, $proxyUsername.':'.$proxyPassword);
1596 1596
                 if (defined('CURLOPT_PROXYAUTH')) {
1597 1597
                     curl_setopt($curl, CURLOPT_PROXYAUTH, $proxyAuthType);
1598 1598
                 } elseif ($proxyAuthType != 1) {
1599 1599
                     /// @todo make this a proper error, i.e. return a failure
1600
-                    $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth to proxy is supported by the current PHP/curl install');
1600
+                    $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. Only Basic auth to proxy is supported by the current PHP/curl install');
1601 1601
                 }
1602 1602
             }
1603 1603
         }
@@ -1607,7 +1607,7 @@  discard block
 block discarded – undo
1607 1607
         if (count($this->cookies)) {
1608 1608
             $cookieHeader = '';
1609 1609
             foreach ($this->cookies as $name => $cookie) {
1610
-                $cookieHeader .= $name . '=' . $cookie['value'] . '; ';
1610
+                $cookieHeader .= $name.'='.$cookie['value'].'; ';
1611 1611
             }
1612 1612
             curl_setopt($curl, CURLOPT_COOKIE, substr($cookieHeader, 0, -2));
1613 1613
         }
@@ -1616,7 +1616,7 @@  discard block
 block discarded – undo
1616 1616
             curl_setopt($curl, $opt, $val);
1617 1617
         }
1618 1618
 
1619
-        if ($this->debug > 1) {
1619
+        if ($this->debug>1) {
1620 1620
             $this->getLogger()->debug("---SENDING---\n$payload\n---END---");
1621 1621
         }
1622 1622
 
@@ -1707,7 +1707,7 @@  discard block
 block discarded – undo
1707 1707
             $call['methodName'] = new Value($req->method(), 'string');
1708 1708
             $numParams = $req->getNumParams();
1709 1709
             $params = array();
1710
-            for ($i = 0; $i < $numParams; $i++) {
1710
+            for ($i = 0; $i<$numParams; $i++) {
1711 1711
                 $params[$i] = $req->getParam($i);
1712 1712
             }
1713 1713
             $call['params'] = new Value($params, 'array');
@@ -1729,7 +1729,7 @@  discard block
 block discarded – undo
1729 1729
         $response = array();
1730 1730
 
1731 1731
         if ($this->return_type == 'xml') {
1732
-            for ($i = 0; $i < count($reqs); $i++) {
1732
+            for ($i = 0; $i<count($reqs); $i++) {
1733 1733
                 $response[] = new Response($rets, 0, '', 'xml', $result->httpResponse());
1734 1734
             }
1735 1735
 
@@ -1737,21 +1737,21 @@  discard block
 block discarded – undo
1737 1737
             if (!is_array($rets)) {
1738 1738
                 // bad return type from system.multicall
1739 1739
                 return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'],
1740
-                    PhpXmlRpc::$xmlrpcstr['multicall_error'] . ': not an array', 'phpvals', $result->httpResponse());
1740
+                    PhpXmlRpc::$xmlrpcstr['multicall_error'].': not an array', 'phpvals', $result->httpResponse());
1741 1741
             }
1742 1742
             $numRets = count($rets);
1743 1743
             if ($numRets != count($reqs)) {
1744 1744
                 // wrong number of return values.
1745 1745
                 return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'],
1746
-                    PhpXmlRpc::$xmlrpcstr['multicall_error'] . ': incorrect number of responses', 'phpvals',
1746
+                    PhpXmlRpc::$xmlrpcstr['multicall_error'].': incorrect number of responses', 'phpvals',
1747 1747
                     $result->httpResponse());
1748 1748
             }
1749 1749
 
1750
-            for ($i = 0; $i < $numRets; $i++) {
1750
+            for ($i = 0; $i<$numRets; $i++) {
1751 1751
                 $val = $rets[$i];
1752 1752
                 if (!is_array($val)) {
1753 1753
                     return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'],
1754
-                        PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i is not an array or struct",
1754
+                        PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i is not an array or struct",
1755 1755
                         'phpvals', $result->httpResponse());
1756 1756
                 }
1757 1757
                 switch (count($val)) {
@@ -1759,7 +1759,7 @@  discard block
 block discarded – undo
1759 1759
                         if (!isset($val[0])) {
1760 1760
                             // Bad value
1761 1761
                             return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'],
1762
-                                PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has no value",
1762
+                                PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has no value",
1763 1763
                                 'phpvals', $result->httpResponse());
1764 1764
                         }
1765 1765
                         // Normal return value
@@ -1771,20 +1771,20 @@  discard block
 block discarded – undo
1771 1771
                         if (!is_int($code)) {
1772 1772
                             /// @todo should we check that it is != 0?
1773 1773
                             return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'],
1774
-                                PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has invalid or no faultCode",
1774
+                                PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has invalid or no faultCode",
1775 1775
                                 'phpvals', $result->httpResponse());
1776 1776
                         }
1777 1777
                         $str = @$val['faultString'];
1778 1778
                         if (!is_string($str)) {
1779 1779
                             return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'],
1780
-                                PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has invalid or no FaultString",
1780
+                                PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has invalid or no FaultString",
1781 1781
                                 'phpvals', $result->httpResponse());
1782 1782
                         }
1783 1783
                         $response[$i] = new Response(0, $code, $str, 'phpvals', $result->httpResponse());
1784 1784
                         break;
1785 1785
                     default:
1786 1786
                         return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'],
1787
-                            PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has too many items",
1787
+                            PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has too many items",
1788 1788
                             'phpvals', $result->httpResponse());
1789 1789
                 }
1790 1790
             }
@@ -1793,14 +1793,14 @@  discard block
 block discarded – undo
1793 1793
             // return type == 'xmlrpcvals'
1794 1794
             if ($rets->kindOf() != 'array') {
1795 1795
                 return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'],
1796
-                    PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i is not an array", 'xmlrpcvals',
1796
+                    PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i is not an array", 'xmlrpcvals',
1797 1797
                     $result->httpResponse());
1798 1798
             }
1799 1799
             $numRets = $rets->count();
1800 1800
             if ($numRets != count($reqs)) {
1801 1801
                 // wrong number of return values.
1802 1802
                 return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'],
1803
-                    PhpXmlRpc::$xmlrpcstr['multicall_error'] . ': incorrect number of responses', 'xmlrpcvals',
1803
+                    PhpXmlRpc::$xmlrpcstr['multicall_error'].': incorrect number of responses', 'xmlrpcvals',
1804 1804
                     $result->httpResponse());
1805 1805
             }
1806 1806
 
@@ -1809,7 +1809,7 @@  discard block
 block discarded – undo
1809 1809
                     case 'array':
1810 1810
                         if ($val->count() != 1) {
1811 1811
                             return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'],
1812
-                                PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has too many items",
1812
+                                PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has too many items",
1813 1813
                                 'phpvals', $result->httpResponse());
1814 1814
                         }
1815 1815
                         // Normal return value
@@ -1818,28 +1818,28 @@  discard block
 block discarded – undo
1818 1818
                     case 'struct':
1819 1819
                         if ($val->count() != 2) {
1820 1820
                             return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'],
1821
-                                PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has too many items",
1821
+                                PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has too many items",
1822 1822
                                 'phpvals', $result->httpResponse());
1823 1823
                         }
1824 1824
                         /** @var Value $code */
1825 1825
                         $code = $val['faultCode'];
1826 1826
                         if ($code->kindOf() != 'scalar' || $code->scalarTyp() != 'int') {
1827 1827
                             return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'],
1828
-                                PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has invalid or no faultCode",
1828
+                                PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has invalid or no faultCode",
1829 1829
                                 'xmlrpcvals', $result->httpResponse());
1830 1830
                         }
1831 1831
                         /** @var Value $str */
1832 1832
                         $str = $val['faultString'];
1833 1833
                         if ($str->kindOf() != 'scalar' || $str->scalarTyp() != 'string') {
1834 1834
                             return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'],
1835
-                                PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has invalid or no faultCode",
1835
+                                PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has invalid or no faultCode",
1836 1836
                                 'xmlrpcvals', $result->httpResponse());
1837 1837
                         }
1838 1838
                         $response[] = new Response(0, $code->scalarVal(), $str->scalarVal(), 'xmlrpcvals', $result->httpResponse());
1839 1839
                         break;
1840 1840
                     default:
1841 1841
                         return new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'],
1842
-                            PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i is not an array or struct",
1842
+                            PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i is not an array or struct",
1843 1843
                             'xmlrpcvals', $result->httpResponse());
1844 1844
                 }
1845 1845
             }
Please login to merge, or discard this patch.