Passed
Push — master ( 18715e...cc36f0 )
by Gaetano
18:17 queued 08:23
created
debugger/action.php 1 patch
Spacing   +115 added lines, -115 removed lines patch added patch discarded remove patch
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
78 78
 <body>
79 79
 <?php
80 80
 
81
-include __DIR__ . '/common.php';
81
+include __DIR__.'/common.php';
82 82
 
83 83
 if ($action) {
84 84
 
85 85
     // avoid php hanging when using the builtin webserver and sending requests to itself
86 86
     $skip = false;
87
-    if (php_sapi_name() === 'cli-server' && ((int)getenv('PHP_CLI_SERVER_WORKERS') < 2)) {
87
+    if (php_sapi_name() === 'cli-server' && ((int) getenv('PHP_CLI_SERVER_WORKERS')<2)) {
88 88
         $localHost = explode(':', $_SERVER['HTTP_HOST']);
89 89
         /// @todo support also case where port is null (on either side), and when there is a Proxy in the parameters,
90 90
         ///       and that proxy is us
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     if (!$skip) {
98 98
         // make sure the script waits long enough for the call to complete...
99 99
         if ($timeout) {
100
-            set_time_limit($timeout + 10);
100
+            set_time_limit($timeout+10);
101 101
         }
102 102
 
103 103
         if ($wstype == 1) {
@@ -118,13 +118,13 @@  discard block
 block discarded – undo
118 118
             $server = "$host$path";
119 119
         }
120 120
         if ($protocol == 2 || $protocol == 3) {
121
-            $server = 'https://' . $server;
121
+            $server = 'https://'.$server;
122 122
         } else {
123
-            $server = 'http://' . $server;
123
+            $server = 'http://'.$server;
124 124
         }
125 125
         if ($proxy != '') {
126 126
             $pproxy = explode(':', $proxy);
127
-            if (count($pproxy) > 1) {
127
+            if (count($pproxy)>1) {
128 128
                 $pport = $pproxy[1];
129 129
             } else {
130 130
                 $pport = 8080;
@@ -199,9 +199,9 @@  discard block
 block discarded – undo
199 199
             case 'wrap':
200 200
                 $msg[0] = new $requestClass('system.methodHelp', array(), $id);
201 201
                 $msg[0]->addparam(new PhpXmlRpc\Value($method));
202
-                $msg[1] = new $requestClass('system.methodSignature', array(), (int)$id + 1);
202
+                $msg[1] = new $requestClass('system.methodSignature', array(), (int) $id+1);
203 203
                 $msg[1]->addparam(new PhpXmlRpc\Value($method));
204
-                $actionname = 'Description of method "' . $method . '"';
204
+                $actionname = 'Description of method "'.$method.'"';
205 205
                 break;
206 206
             case 'list':
207 207
                 $msg[0] = new $requestClass('system.listMethods', array(), $id);
@@ -214,9 +214,9 @@  discard block
 block discarded – undo
214 214
                 $msg[0] = new $requestClass($method, array(), $id);
215 215
                 // hack! build payload by hand
216 216
                 if ($wstype == 1) {
217
-                    $payload = "{\n" .
218
-                        '"method": "' . $method . "\",\n\"params\": [" .
219
-                        $payload .
217
+                    $payload = "{\n".
218
+                        '"method": "'.$method."\",\n\"params\": [".
219
+                        $payload.
220 220
                         "\n],\n\"id\": ";
221 221
                     // fix: if user gave an empty string, use NULL, or we'll break json syntax
222 222
                     if ($id == "") {
@@ -231,22 +231,22 @@  discard block
 block discarded – undo
231 231
                     $msg[0]->setPayload($payload);
232 232
                 } else {
233 233
                     $msg[0]->setPayload(
234
-                        $msg[0]->xml_header($inputcharset) .
235
-                        '<methodName>' . $method . "</methodName>\n<params>" .
236
-                        $payload .
237
-                        "</params>\n" . $msg[0]->xml_footer()
234
+                        $msg[0]->xml_header($inputcharset).
235
+                        '<methodName>'.$method."</methodName>\n<params>".
236
+                        $payload.
237
+                        "</params>\n".$msg[0]->xml_footer()
238 238
                     );
239 239
                 }
240
-                $actionname = 'Execution of method ' . $method;
240
+                $actionname = 'Execution of method '.$method;
241 241
                 break;
242 242
             default: // give a warning
243
-                $actionname = '[ERROR: unknown action] "' . $action . '"';
243
+                $actionname = '[ERROR: unknown action] "'.$action.'"';
244 244
         }
245 245
     }
246 246
 
247 247
     // Before calling execute, echo out brief description of action taken + date and time ???
248 248
     // this gives good user feedback for long-running methods...
249
-    echo '<h2>' . htmlspecialchars($actionname, ENT_COMPAT, $inputcharset) . ' on server ' . htmlspecialchars($server, ENT_COMPAT, $inputcharset) . " ...</h2>\n";
249
+    echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset)." ...</h2>\n";
250 250
     flush();
251 251
 
252 252
     $response = null;
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
             break;
264 264
         }
265 265
     }
266
-    $time = microtime(true) - $time;
266
+    $time = microtime(true)-$time;
267 267
     if ($debug) {
268 268
         echo "</div>\n";
269 269
     }
@@ -273,8 +273,8 @@  discard block
 block discarded – undo
273 273
             // call failed! echo out error msg!
274 274
             //echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset).'</h2>';
275 275
             echo "<h3>$protoName call FAILED!</h3>\n";
276
-            echo "<p>Fault code: [" . htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
277
-                "] Reason: '" . htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "'</p>\n";
276
+            echo "<p>Fault code: [".htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding).
277
+                "] Reason: '".htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."'</p>\n";
278 278
             echo(date("d/M/Y:H:i:s\n"));
279 279
         } else {
280 280
             // call succeeded: parse results
@@ -290,36 +290,36 @@  discard block
 block discarded – undo
290 290
                         $max = $v->count();
291 291
                         echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
292 292
                         echo "<thead>\n<tr><th>Method ($max)</th><th>Description</th></tr>\n</thead>\n<tbody>\n";
293
-                        foreach($v as $i => $rec) {
293
+                        foreach ($v as $i => $rec) {
294 294
                             if ($i % 2) {
295 295
                                 $class = ' class="oddrow"';
296 296
                             } else {
297 297
                                 $class = ' class="evenrow"';
298 298
                             }
299
-                            echo("<tr><td$class>" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">" .
300
-                                "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" .
301
-                                "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" .
302
-                                "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" .
303
-                                "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" .
304
-                                "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" .
305
-                                "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" .
306
-                                "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" .
307
-                                "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" .
308
-                                "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" .
309
-                                "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" .
310
-                                "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" .
311
-                                "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" .
312
-                                "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" .
313
-                                "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" .
314
-                                "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" .
315
-                                "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" .
316
-                                "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" .
317
-                                "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" .
318
-                                "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" .
319
-                                "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "\" />" .
320
-                                "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" .
321
-                                "<input type=\"hidden\" name=\"action\" value=\"describe\" />" .
322
-                                "<input type=\"hidden\" name=\"run\" value=\"now\" />" .
299
+                            echo("<tr><td$class>".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">".
300
+                                "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />".
301
+                                "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />".
302
+                                "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />".
303
+                                "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />".
304
+                                "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />".
305
+                                "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />".
306
+                                "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />".
307
+                                "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />".
308
+                                "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />".
309
+                                "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />".
310
+                                "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />".
311
+                                "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />".
312
+                                "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />".
313
+                                "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />".
314
+                                "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />".
315
+                                "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />".
316
+                                "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />".
317
+                                "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />".
318
+                                "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />".
319
+                                "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."\" />".
320
+                                "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />".
321
+                                "<input type=\"hidden\" name=\"action\" value=\"describe\" />".
322
+                                "<input type=\"hidden\" name=\"run\" value=\"now\" />".
323 323
                                 "<input type=\"submit\" value=\"Describe\" /></form></td>");
324 324
                             //echo("</tr>\n");
325 325
 
@@ -346,7 +346,7 @@  discard block
 block discarded – undo
346 346
                     $r2 = $resp[1]->value();
347 347
 
348 348
                     echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
349
-                    echo "<thead>\n<tr><th>Method</th><th>" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "</th><th>&nbsp;</th><th>&nbsp;</th></tr>\n</thead>\n<tbody>\n";
349
+                    echo "<thead>\n<tr><th>Method</th><th>".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."</th><th>&nbsp;</th><th>&nbsp;</th></tr>\n</thead>\n<tbody>\n";
350 350
                     $desc = htmlspecialchars($r1->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding);
351 351
                     if ($desc == "") {
352 352
                         $desc = "-";
@@ -356,24 +356,24 @@  discard block
 block discarded – undo
356 356
                     if ($r2->kindOf() != "array") {
357 357
                         echo "<tr><td class=\"oddrow\">Signature</td><td class=\"oddrow\">Unknown</td><td class=\"oddrow\">&nbsp;</td></tr>\n";
358 358
                     } else {
359
-                        foreach($r2 as $i => $x) {
359
+                        foreach ($r2 as $i => $x) {
360 360
                             $payload = "";
361 361
                             $alt_payload = "";
362
-                            if ($i + 1 % 2) {
362
+                            if ($i+1 % 2) {
363 363
                                 $class = ' class="oddrow"';
364 364
                             } else {
365 365
                                 $class = ' class="evenrow"';
366 366
                             }
367
-                            echo "<tr><td$class>Signature&nbsp;" . ($i + 1) . "</td><td$class>";
367
+                            echo "<tr><td$class>Signature&nbsp;".($i+1)."</td><td$class>";
368 368
                             if ($x->kindOf() == "array") {
369 369
                                 $ret = $x[0];
370
-                                echo "<code>OUT:&nbsp;" . htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "<br />IN: (";
371
-                                if ($x->count() > 1) {
372
-                                    foreach($x as $k => $y) {
370
+                                echo "<code>OUT:&nbsp;".htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."<br />IN: (";
371
+                                if ($x->count()>1) {
372
+                                    foreach ($x as $k => $y) {
373 373
                                         if ($k == 0) continue;
374 374
                                         echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding);
375 375
                                         if ($wstype == 1) {
376
-                                            switch($y->scalarval()) {
376
+                                            switch ($y->scalarval()) {
377 377
                                                 case 'string':
378 378
                                                 case 'dateTime.iso8601':
379 379
                                                 case 'base64':
@@ -406,22 +406,22 @@  discard block
 block discarded – undo
406 406
                                         } else {
407 407
                                             $type = $y->scalarval();
408 408
                                             $payload .= '<param><value>';
409
-                                            switch($type) {
409
+                                            switch ($type) {
410 410
                                                 case 'undefined':
411 411
                                                     break;
412 412
                                                 case 'null';
413 413
                                                     $type = 'nil';
414 414
                                                     // fall thru intentionally
415 415
                                                 default:
416
-                                                    $payload .= '<' .
417
-                                                        htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
418
-                                                        '></' . htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
416
+                                                    $payload .= '<'.
417
+                                                        htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding).
418
+                                                        '></'.htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding).
419 419
                                                         '>';
420 420
                                             }
421 421
                                             $payload .= "</value></param>\n";
422 422
                                         }
423 423
                                         $alt_payload .= $y->scalarval();
424
-                                        if ($k < $x->count() - 1) {
424
+                                        if ($k<$x->count()-1) {
425 425
                                             $alt_payload .= ';';
426 426
                                             if ($wstype == 1) {
427 427
                                                 $payload .= ', ';
@@ -437,63 +437,63 @@  discard block
 block discarded – undo
437 437
                             echo '</td>';
438 438
                             // button to test this method
439 439
                             //$payload="<methodCall>\n<methodName>$method</methodName>\n<params>\n$payload</params>\n</methodCall>";
440
-                            echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" .
441
-                                "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" .
442
-                                "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" .
443
-                                "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" .
444
-                                "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" .
445
-                                "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" .
446
-                                "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" .
447
-                                "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" .
448
-                                "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" .
449
-                                "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" .
450
-                                "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" .
451
-                                "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" .
452
-                                "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" .
453
-                                "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" .
454
-                                "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" .
455
-                                "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" .
456
-                                "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" .
457
-                                "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" .
458
-                                "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" .
459
-                                "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" .
460
-                                "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" .
461
-                                "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" .
462
-                                "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" .
463
-                                "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" .
440
+                            echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">".
441
+                                "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />".
442
+                                "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />".
443
+                                "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />".
444
+                                "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />".
445
+                                "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />".
446
+                                "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />".
447
+                                "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />".
448
+                                "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />".
449
+                                "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />".
450
+                                "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />".
451
+                                "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />".
452
+                                "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />".
453
+                                "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />".
454
+                                "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />".
455
+                                "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />".
456
+                                "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />".
457
+                                "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />".
458
+                                "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />".
459
+                                "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />".
460
+                                "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />".
461
+                                "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />".
462
+                                "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />".
463
+                                "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />".
464 464
                                 "<input type=\"hidden\" name=\"action\" value=\"execute\" />";
465 465
                             //if ($wstype != 1) {
466 466
                                 echo "<input type=\"submit\" value=\"Load method synopsis\" />";
467 467
                             //}
468 468
                             echo "</form></td>\n";
469 469
 
470
-                            echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" .
471
-                                "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" .
472
-                                "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" .
473
-                                "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" .
474
-                                "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" .
475
-                                "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" .
476
-                                "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" .
477
-                                "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" .
478
-                                "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" .
479
-                                "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" .
480
-                                "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" .
481
-                                "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" .
482
-                                "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" .
483
-                                "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" .
484
-                                "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" .
485
-                                "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" .
486
-                                "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" .
487
-                                "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" .
488
-                                "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" .
489
-                                "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" .
490
-                                "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" .
491
-                                "<input type=\"hidden\" name=\"methodsig\" value=\"" . $i . "\" />" .
492
-                                "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" .
493
-                                "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" .
494
-                                "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" .
495
-                                "<input type=\"hidden\" name=\"action\" value=\"wrap\" />" .
496
-                                "<input type=\"hidden\" name=\"run\" value=\"now\" />" .
470
+                            echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">".
471
+                                "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />".
472
+                                "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />".
473
+                                "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />".
474
+                                "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />".
475
+                                "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />".
476
+                                "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />".
477
+                                "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />".
478
+                                "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />".
479
+                                "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />".
480
+                                "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />".
481
+                                "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />".
482
+                                "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />".
483
+                                "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />".
484
+                                "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />".
485
+                                "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />".
486
+                                "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />".
487
+                                "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />".
488
+                                "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />".
489
+                                "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />".
490
+                                "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />".
491
+                                "<input type=\"hidden\" name=\"methodsig\" value=\"".$i."\" />".
492
+                                "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />".
493
+                                "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />".
494
+                                "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />".
495
+                                "<input type=\"hidden\" name=\"action\" value=\"wrap\" />".
496
+                                "<input type=\"hidden\" name=\"run\" value=\"now\" />".
497 497
                                 "<input type=\"submit\" value=\"Generate method call stub code\" />";
498 498
                             echo "</form></td></tr>\n";
499 499
                         }
@@ -505,14 +505,14 @@  discard block
 block discarded – undo
505 505
                 case 'wrap':
506 506
                     $r1 = $resp[0]->value();
507 507
                     $r2 = $resp[1]->value();
508
-                    if ($r2->kindOf() != "array" || $r2->count() <= $methodsig) {
508
+                    if ($r2->kindOf() != "array" || $r2->count()<=$methodsig) {
509 509
                         echo "Error: signature unknown\n";
510 510
                     } else {
511 511
                         $mdesc = $r1->scalarval();
512 512
                         $encoder = new PhpXmlRpc\Encoder();
513 513
                         $msig = $encoder->decode($r2);
514 514
                         $msig = $msig[$methodsig];
515
-                        $proto = ($protocol == 1) ? 'http11' : ( $protocol == 2 ? 'https' : ( $protocol == 3 ? 'h2' : ( $protocol == 4 ? 'h2c' : '' ) ) );
515
+                        $proto = ($protocol == 1) ? 'http11' : ($protocol == 2 ? 'https' : ($protocol == 3 ? 'h2' : ($protocol == 4 ? 'h2c' : '')));
516 516
                         if ($proxy == '' && $username == '' && !$requestcompression && !$responsecompression &&
517 517
                             $clientcookies == '') {
518 518
                             $opts = 1; // simple client copy in stub code
@@ -533,12 +533,12 @@  discard block
 block discarded – undo
533 533
                             $client,
534 534
                             $method,
535 535
                             array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix, 'throw_on_fault' => true),
536
-                            str_replace('.', '_', $prefix . '_' . $method), $msig, $mdesc
536
+                            str_replace('.', '_', $prefix.'_'.$method), $msig, $mdesc
537 537
                         );
538 538
                         //if ($code)
539 539
                         //{
540 540
                         echo "<div id=\"phpcode\">\n";
541
-                        highlight_string("<?php\n" . $code['docstring'] . $code['source']);
541
+                        highlight_string("<?php\n".$code['docstring'].$code['source']);
542 542
                         echo "\n</div>";
543 543
                         //}
544 544
                         //else
@@ -549,7 +549,7 @@  discard block
 block discarded – undo
549 549
                     break;
550 550
 
551 551
                 case 'execute':
552
-                    echo '<div id="response"><h2>Response:</h2>' . htmlspecialchars($response->serialize()) . '</div>';
552
+                    echo '<div id="response"><h2>Response:</h2>'.htmlspecialchars($response->serialize()).'</div>';
553 553
                     break;
554 554
 
555 555
                 default: // give a warning
Please login to merge, or discard this patch.
tests/08ServerTest.php 1 patch
Spacing   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/../lib/xmlrpc_wrappers.inc';
3
+include_once __DIR__.'/../lib/xmlrpc_wrappers.inc';
4 4
 
5
-include_once __DIR__ . '/ServerAwareTestCase.php';
5
+include_once __DIR__.'/ServerAwareTestCase.php';
6 6
 
7 7
 /**
8 8
  * Tests which involve interaction with the server - carried out via the client.
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         // (but only if not called from subclass objects / multitests)
30 30
         if (function_exists('debug_backtrace') && strtolower(get_called_class()) == 'localhosttests') {
31 31
             $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
32
-            for ($i = 0; $i < count($trace); $i++) {
32
+            for ($i = 0; $i<count($trace); $i++) {
33 33
                 if (strpos($trace[$i]['function'], 'test') === 0) {
34 34
                     self::$failed_tests[$trace[$i]['function']] = true;
35 35
                     break;
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
         parent::set_up();
46 46
 
47 47
         $server = explode(':', $this->args['HTTPSERVER']);
48
-        if (count($server) > 1) {
48
+        if (count($server)>1) {
49 49
             $this->client = new xmlrpc_client($this->args['HTTPURI'], $server[0], $server[1]);
50 50
         } else {
51 51
             $this->client = new xmlrpc_client($this->args['HTTPURI'], $this->args['HTTPSERVER']);
@@ -75,9 +75,9 @@  discard block
 block discarded – undo
75 75
         }
76 76
         $this->validateResponse($r);
77 77
         if (is_array($errorCode)) {
78
-            $this->assertContains($r->faultCode(), $errorCode, 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString());
78
+            $this->assertContains($r->faultCode(), $errorCode, 'Error '.$r->faultCode().' connecting to server: '.$r->faultString());
79 79
         } else {
80
-            $this->assertEquals($errorCode, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString());
80
+            $this->assertEquals($errorCode, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString());
81 81
         }
82 82
         if (!$r->faultCode()) {
83 83
             if ($returnResponse) {
@@ -104,20 +104,20 @@  discard block
 block discarded – undo
104 104
         $query = parse_url($this->client->path, PHP_URL_QUERY);
105 105
         parse_str($query, $vars);
106 106
         $query = http_build_query(array_merge($vars, $data));
107
-        $this->client->path = parse_url($this->client->path, PHP_URL_PATH) . '?' . $query;
107
+        $this->client->path = parse_url($this->client->path, PHP_URL_PATH).'?'.$query;
108 108
     }
109 109
 
110 110
     public function testString()
111 111
     {
112
-        $sendString = "here are 3 \"entities\": < > & " .
113
-            "and here's a dollar sign: \$pretendvarname and a backslash too: " . chr(92) .
114
-            " - isn't that great? \\\"hackery\\\" at it's best " .
115
-            " also don't want to miss out on \$item[0]. " .
116
-            "The real weird stuff follows: CRLF here" . chr(13) . chr(10) .
117
-            "a simple CR here" . chr(13) .
118
-            "a simple LF here" . chr(10) .
119
-            "and then LFCR" . chr(10) . chr(13) .
120
-            "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne, and an xml comment closing tag: -->";
112
+        $sendString = "here are 3 \"entities\": < > & ".
113
+            "and here's a dollar sign: \$pretendvarname and a backslash too: ".chr(92).
114
+            " - isn't that great? \\\"hackery\\\" at it's best ".
115
+            " also don't want to miss out on \$item[0]. ".
116
+            "The real weird stuff follows: CRLF here".chr(13).chr(10).
117
+            "a simple CR here".chr(13).
118
+            "a simple LF here".chr(10).
119
+            "and then LFCR".chr(10).chr(13).
120
+            "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne, and an xml comment closing tag: -->";
121 121
         $m = new xmlrpcmsg('examples.stringecho', array(
122 122
             new xmlrpcval($sendString, 'string'),
123 123
         ));
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
     public function testLatin1String()
139 139
     {
140 140
         $sendString =
141
-            "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne";
141
+            "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne";
142 142
         $x = '<?xml version="1.0" encoding="ISO-8859-1"?><methodCall><methodName>examples.stringecho</methodName><params><param><value>'.
143 143
             $sendString.
144 144
             '</value></param></params></methodCall>';
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
     public function testUtf8Method()
248 248
     {
249 249
         PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding = 'UTF-8';
250
-        $m = new xmlrpcmsg("tests.utf8methodname." . 'κόσμε', array(
250
+        $m = new xmlrpcmsg("tests.utf8methodname.".'κόσμε', array(
251 251
             new xmlrpcval('hello')
252 252
         ));
253 253
         $v = $this->send($m);
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
         ));
269 269
         $v = $this->send($m);
270 270
         if ($v) {
271
-            $this->assertEquals($a + $b, $v->scalarval());
271
+            $this->assertEquals($a+$b, $v->scalarval());
272 272
         }
273 273
     }
274 274
 
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
         ));
281 281
         $v = $this->send($m);
282 282
         if ($v) {
283
-            $this->assertEquals(12 - 23, $v->scalarval());
283
+            $this->assertEquals(12-23, $v->scalarval());
284 284
         }
285 285
     }
286 286
 
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
         if ($v) {
320 320
             $sz = $v->arraysize();
321 321
             $got = '';
322
-            for ($i = 0; $i < $sz; $i++) {
322
+            for ($i = 0; $i<$sz; $i++) {
323 323
                 $b = $v->arraymem($i);
324 324
                 if ($b->scalarval()) {
325 325
                     $got .= '1';
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
             $got = '';
367 367
             $expected = '37210';
368 368
             $expect_array = array('ctLeftAngleBrackets', 'ctRightAngleBrackets', 'ctAmpersands', 'ctApostrophes', 'ctQuotes');
369
-            foreach($expect_array as $val) {
369
+            foreach ($expect_array as $val) {
370 370
                 $b = $v->structmem($val);
371 371
                 $got .= $b->scalarVal();
372 372
             }
@@ -868,7 +868,7 @@  discard block
 block discarded – undo
868 868
     {
869 869
         // make a 'deep client copy' as the original one might have many properties set
870 870
         // also for speed only wrap one method of the whole server
871
-        $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/' ));
871
+        $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/'));
872 872
         if ($class == '') {
873 873
             $this->fail('Registration of remote server failed');
874 874
         } else {
@@ -907,9 +907,9 @@  discard block
 block discarded – undo
907 907
         $cookies = array(
908 908
             //'c1' => array(),
909 909
             'c2' => array('value' => 'c2'),
910
-            'c3' => array('value' => 'c3', 'expires' => time() + 60 * 60 * 24 * 30),
911
-            'c4' => array('value' => 'c4', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/'),
912
-            'c5' => array('value' => 'c5', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'),
910
+            'c3' => array('value' => 'c3', 'expires' => time()+60 * 60 * 24 * 30),
911
+            'c4' => array('value' => 'c4', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/'),
912
+            'c5' => array('value' => 'c5', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'),
913 913
         );
914 914
         $cookiesval = php_xmlrpc_encode($cookies);
915 915
         $m = new xmlrpcmsg('tests.setcookies', array($cookiesval));
@@ -957,10 +957,10 @@  discard block
 block discarded – undo
957 957
         $m = new xmlrpcmsg('tests.getcookies', array());
958 958
         foreach ($cookies as $cookie => $val) {
959 959
             $this->client->setCookie($cookie, $val);
960
-            $cookies[$cookie] = (string)$cookies[$cookie];
960
+            $cookies[$cookie] = (string) $cookies[$cookie];
961 961
         }
962 962
         $r = $this->client->send($m, $this->timeout, $this->method);
963
-        $this->assertEquals(0, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString());
963
+        $this->assertEquals(0, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString());
964 964
         if (!$r->faultCode()) {
965 965
             $v = $r->value();
966 966
             $v = php_xmlrpc_decode($v);
Please login to merge, or discard this patch.
src/Response.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
                 // user declares the type of resp value: we "almost" trust it... but log errors just in case
79 79
                 if (($this->valtyp == 'xmlrpcvals' && (!is_a($this->val, 'PhpXmlRpc\Value'))) ||
80 80
                     ($this->valtyp == 'xml' && (!is_string($this->val)))) {
81
-                    $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': value passed in does not match type ' . $valType);
81
+                    $this->getLogger()->error('XML-RPC: '.__METHOD__.': value passed in does not match type '.$valType);
82 82
                 }
83 83
             }
84 84
         }
@@ -165,34 +165,34 @@  discard block
 block discarded – undo
165 165
     public function serialize($charsetEncoding = '')
166 166
     {
167 167
         if ($charsetEncoding != '') {
168
-            $this->content_type = 'text/xml; charset=' . $charsetEncoding;
168
+            $this->content_type = 'text/xml; charset='.$charsetEncoding;
169 169
         } else {
170 170
             $this->content_type = 'text/xml';
171 171
         }
172 172
 
173 173
         if (PhpXmlRpc::$xmlrpc_null_apache_encoding) {
174
-            $result = "<methodResponse xmlns:ex=\"" . PhpXmlRpc::$xmlrpc_null_apache_encoding_ns . "\">\n";
174
+            $result = "<methodResponse xmlns:ex=\"".PhpXmlRpc::$xmlrpc_null_apache_encoding_ns."\">\n";
175 175
         } else {
176 176
             $result = "<methodResponse>\n";
177 177
         }
178 178
         if ($this->errno) {
179 179
             // Let non-ASCII response messages be tolerated by clients by xml-encoding non ascii chars
180
-            $result .= "<fault>\n" .
181
-                "<value>\n<struct><member><name>faultCode</name>\n<value><int>" . $this->errno .
182
-                "</int></value>\n</member>\n<member>\n<name>faultString</name>\n<value><string>" .
183
-                $this->getCharsetEncoder()->encodeEntities($this->errstr, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) .
180
+            $result .= "<fault>\n".
181
+                "<value>\n<struct><member><name>faultCode</name>\n<value><int>".$this->errno.
182
+                "</int></value>\n</member>\n<member>\n<name>faultString</name>\n<value><string>".
183
+                $this->getCharsetEncoder()->encodeEntities($this->errstr, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding).
184 184
                 "</string></value>\n</member>\n</struct>\n</value>\n</fault>";
185 185
         } else {
186 186
             if (is_object($this->val) && is_a($this->val, 'PhpXmlRpc\Value')) {
187
-                $result .= "<params>\n<param>\n" . $this->val->serialize($charsetEncoding) . "</param>\n</params>";
187
+                $result .= "<params>\n<param>\n".$this->val->serialize($charsetEncoding)."</param>\n</params>";
188 188
             } else if (is_string($this->val) && $this->valtyp == 'xml') {
189
-                $result .= "<params>\n<param>\n" .
190
-                    $this->val .
189
+                $result .= "<params>\n<param>\n".
190
+                    $this->val.
191 191
                     "</param>\n</params>";
192 192
             } else if ($this->valtyp == 'phpvals') {
193 193
                     $encoder = new Encoder();
194 194
                     $val = $encoder->encode($this->val);
195
-                    $result .= "<params>\n<param>\n" . $val->serialize($charsetEncoding) . "</param>\n</params>";
195
+                    $result .= "<params>\n<param>\n".$val->serialize($charsetEncoding)."</param>\n</params>";
196 196
             } else {
197 197
                 throw new StateErrorException('cannot serialize xmlrpc response objects whose content is native php values');
198 198
             }
@@ -211,9 +211,9 @@  discard block
 block discarded – undo
211 211
     public function xml_header($charsetEncoding = '')
212 212
     {
213 213
         if ($charsetEncoding != '') {
214
-            return "<?xml version=\"1.0\" encoding=\"$charsetEncoding\"?" . ">\n";
214
+            return "<?xml version=\"1.0\" encoding=\"$charsetEncoding\"?".">\n";
215 215
         } else {
216
-            return "<?xml version=\"1.0\"?" . ">\n";
216
+            return "<?xml version=\"1.0\"?".">\n";
217 217
         }
218 218
     }
219 219
 
@@ -229,21 +229,21 @@  discard block
 block discarded – undo
229 229
             case 'errstr':
230 230
             case 'payload':
231 231
             case 'content_type':
232
-                $this->logDeprecation('Getting property Response::' . $name . ' is deprecated');
232
+                $this->logDeprecation('Getting property Response::'.$name.' is deprecated');
233 233
                 return $this->$name;
234 234
             case 'hdrs':
235
-                $this->logDeprecation('Getting property Response::' . $name . ' is deprecated');
235
+                $this->logDeprecation('Getting property Response::'.$name.' is deprecated');
236 236
                 return $this->httpResponse['headers'];
237 237
             case '_cookies':
238
-                $this->logDeprecation('Getting property Response::' . $name . ' is deprecated');
238
+                $this->logDeprecation('Getting property Response::'.$name.' is deprecated');
239 239
                 return $this->httpResponse['cookies'];
240 240
             case 'raw_data':
241
-                $this->logDeprecation('Getting property Response::' . $name . ' is deprecated');
241
+                $this->logDeprecation('Getting property Response::'.$name.' is deprecated');
242 242
                 return $this->httpResponse['raw_data'];
243 243
             default:
244 244
                 /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
245 245
                 $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
246
-                trigger_error('Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING);
246
+                trigger_error('Undefined property via __get(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING);
247 247
                 $result = null;
248 248
                 return $result;
249 249
         }
@@ -258,25 +258,25 @@  discard block
 block discarded – undo
258 258
             case 'errstr':
259 259
             case 'payload':
260 260
             case 'content_type':
261
-                $this->logDeprecation('Setting property Response::' . $name . ' is deprecated');
261
+                $this->logDeprecation('Setting property Response::'.$name.' is deprecated');
262 262
                 $this->$name = $value;
263 263
                 break;
264 264
             case 'hdrs':
265
-                $this->logDeprecation('Setting property Response::' . $name . ' is deprecated');
265
+                $this->logDeprecation('Setting property Response::'.$name.' is deprecated');
266 266
                 $this->httpResponse['headers'] = $value;
267 267
                 break;
268 268
             case '_cookies':
269
-                $this->logDeprecation('Setting property Response::' . $name . ' is deprecated');
269
+                $this->logDeprecation('Setting property Response::'.$name.' is deprecated');
270 270
                 $this->httpResponse['cookies'] = $value;
271 271
                 break;
272 272
             case 'raw_data':
273
-                $this->logDeprecation('Setting property Response::' . $name . ' is deprecated');
273
+                $this->logDeprecation('Setting property Response::'.$name.' is deprecated');
274 274
                 $this->httpResponse['raw_data'] = $value;
275 275
                 break;
276 276
             default:
277 277
                 /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
278 278
                 $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
279
-                trigger_error('Undefined property via __set(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING);
279
+                trigger_error('Undefined property via __set(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING);
280 280
         }
281 281
     }
282 282
 
@@ -289,16 +289,16 @@  discard block
 block discarded – undo
289 289
             case 'errstr':
290 290
             case 'payload':
291 291
             case 'content_type':
292
-                $this->logDeprecation('Checking property Response::' . $name . ' is deprecated');
292
+                $this->logDeprecation('Checking property Response::'.$name.' is deprecated');
293 293
                 return isset($this->$name);
294 294
             case 'hdrs':
295
-                $this->logDeprecation('Checking property Response::' . $name . ' is deprecated');
295
+                $this->logDeprecation('Checking property Response::'.$name.' is deprecated');
296 296
                 return isset($this->httpResponse['headers']);
297 297
             case '_cookies':
298
-                $this->logDeprecation('Checking property Response::' . $name . ' is deprecated');
298
+                $this->logDeprecation('Checking property Response::'.$name.' is deprecated');
299 299
                 return isset($this->httpResponse['cookies']);
300 300
             case 'raw_data':
301
-                $this->logDeprecation('Checking property Response::' . $name . ' is deprecated');
301
+                $this->logDeprecation('Checking property Response::'.$name.' is deprecated');
302 302
                 return isset($this->httpResponse['raw_data']);
303 303
             default:
304 304
                 return false;
@@ -314,25 +314,25 @@  discard block
 block discarded – undo
314 314
             case 'errstr':
315 315
             case 'payload':
316 316
             case 'content_type':
317
-                $this->logDeprecation('Setting property Response::' . $name . ' is deprecated');
317
+                $this->logDeprecation('Setting property Response::'.$name.' is deprecated');
318 318
                 unset($this->$name);
319 319
                 break;
320 320
             case 'hdrs':
321
-                $this->logDeprecation('Unsetting property Response::' . $name . ' is deprecated');
321
+                $this->logDeprecation('Unsetting property Response::'.$name.' is deprecated');
322 322
                 unset($this->httpResponse['headers']);
323 323
                 break;
324 324
             case '_cookies':
325
-                $this->logDeprecation('Unsetting property Response::' . $name . ' is deprecated');
325
+                $this->logDeprecation('Unsetting property Response::'.$name.' is deprecated');
326 326
                 unset($this->httpResponse['cookies']);
327 327
                 break;
328 328
             case 'raw_data':
329
-                $this->logDeprecation('Unsetting property Response::' . $name . ' is deprecated');
329
+                $this->logDeprecation('Unsetting property Response::'.$name.' is deprecated');
330 330
                 unset($this->httpResponse['raw_data']);
331 331
                 break;
332 332
             default:
333 333
                 /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
334 334
                 $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
335
-                trigger_error('Undefined property via __unset(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING);
335
+                trigger_error('Undefined property via __unset(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING);
336 336
         }
337 337
     }
338 338
 }
Please login to merge, or discard this patch.
src/Value.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                     $this->me['struct'] = $val;
99 99
                     break;
100 100
                 default:
101
-                    $this->getLogger()->error("XML-RPC: " . __METHOD__ . ": not a known type ($type)");
101
+                    $this->getLogger()->error("XML-RPC: ".__METHOD__.": not a known type ($type)");
102 102
             }
103 103
         }
104 104
     }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         }
129 129
 
130 130
         if ($typeOf !== 1) {
131
-            $this->getLogger()->error("XML-RPC: " . __METHOD__ . ": not a scalar type ($type)");
131
+            $this->getLogger()->error("XML-RPC: ".__METHOD__.": not a scalar type ($type)");
132 132
             return 0;
133 133
         }
134 134
 
@@ -145,10 +145,10 @@  discard block
 block discarded – undo
145 145
 
146 146
         switch ($this->mytype) {
147 147
             case 1:
148
-                $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': scalar xmlrpc value can have only one value');
148
+                $this->getLogger()->error('XML-RPC: '.__METHOD__.': scalar xmlrpc value can have only one value');
149 149
                 return 0;
150 150
             case 3:
151
-                $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': cannot add anonymous scalar to struct xmlrpc value');
151
+                $this->getLogger()->error('XML-RPC: '.__METHOD__.': cannot add anonymous scalar to struct xmlrpc value');
152 152
                 return 0;
153 153
             case 2:
154 154
                 // we're adding a scalar value to an array here
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 
193 193
             return 1;
194 194
         } else {
195
-            $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']');
195
+            $this->getLogger()->error('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']');
196 196
             return 0;
197 197
         }
198 198
     }
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 
224 224
             return 1;
225 225
         } else {
226
-            $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']');
226
+            $this->getLogger()->error('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']');
227 227
             return 0;
228 228
         }
229 229
     }
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
         $val = reset($this->me);
289 289
         $typ = key($this->me);
290 290
 
291
-        return '<value>' . $this->serializeData($typ, $val, $charsetEncoding) . "</value>\n";
291
+        return '<value>'.$this->serializeData($typ, $val, $charsetEncoding)."</value>\n";
292 292
     }
293 293
 
294 294
     /**
@@ -311,19 +311,19 @@  discard block
 block discarded – undo
311 311
             case 1:
312 312
                 switch ($typ) {
313 313
                     case static::$xmlrpcBase64:
314
-                        $rs = "<{$typ}>" . base64_encode($val) . "</{$typ}>";
314
+                        $rs = "<{$typ}>".base64_encode($val)."</{$typ}>";
315 315
                         break;
316 316
                     case static::$xmlrpcBoolean:
317
-                        $rs = "<{$typ}>" . ($val ? '1' : '0') . "</{$typ}>";
317
+                        $rs = "<{$typ}>".($val ? '1' : '0')."</{$typ}>";
318 318
                         break;
319 319
                     case static::$xmlrpcString:
320 320
                         // Do NOT use htmlentities, since it will produce named html entities, which are invalid xml
321
-                        $rs = "<{$typ}>" . $this->getCharsetEncoder()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</{$typ}>";
321
+                        $rs = "<{$typ}>".$this->getCharsetEncoder()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</{$typ}>";
322 322
                         break;
323 323
                     case static::$xmlrpcInt:
324 324
                     case static::$xmlrpcI4:
325 325
                     case static::$xmlrpcI8:
326
-                        $rs = "<{$typ}>" . (int)$val . "</{$typ}>";
326
+                        $rs = "<{$typ}>".(int) $val."</{$typ}>";
327 327
                         break;
328 328
                     case static::$xmlrpcDouble:
329 329
                         // avoid using standard conversion of float to string because it is locale-dependent,
@@ -331,16 +331,16 @@  discard block
 block discarded – undo
331 331
                         // sprintf('%F') could be most likely ok, but it fails e.g. on 2e-14.
332 332
                         // The code below tries its best at keeping max precision while avoiding exp notation,
333 333
                         // but there is of course no limit in the number of decimal places to be used...
334
-                        $rs = "<{$typ}>" . preg_replace('/\\.?0+$/', '', number_format((double)$val, PhpXmlRpc::$xmlpc_double_precision, '.', '')) . "</{$typ}>";
334
+                        $rs = "<{$typ}>".preg_replace('/\\.?0+$/', '', number_format((double) $val, PhpXmlRpc::$xmlpc_double_precision, '.', ''))."</{$typ}>";
335 335
                         break;
336 336
                     case static::$xmlrpcDateTime:
337 337
                         if (is_string($val)) {
338 338
                             $rs = "<{$typ}>{$val}</{$typ}>";
339 339
                         // DateTimeInterface is not present in php 5.4...
340 340
                         } elseif (is_a($val, 'DateTimeInterface') || is_a($val, 'DateTime')) {
341
-                            $rs = "<{$typ}>" . $val->format('Ymd\TH:i:s') . "</{$typ}>";
341
+                            $rs = "<{$typ}>".$val->format('Ymd\TH:i:s')."</{$typ}>";
342 342
                         } elseif (is_int($val)) {
343
-                            $rs = "<{$typ}>" . date('Ymd\TH:i:s', $val) . "</{$typ}>";
343
+                            $rs = "<{$typ}>".date('Ymd\TH:i:s', $val)."</{$typ}>";
344 344
                         } else {
345 345
                             // not really a good idea here: but what should we output anyway? left for backward compat...
346 346
                             $rs = "<{$typ}>{$val}</{$typ}>";
@@ -362,14 +362,14 @@  discard block
 block discarded – undo
362 362
             case 3:
363 363
                 // struct
364 364
                 if ($this->_php_class) {
365
-                    $rs = '<struct php_class="' . $this->_php_class . "\">\n";
365
+                    $rs = '<struct php_class="'.$this->_php_class."\">\n";
366 366
                 } else {
367 367
                     $rs = "<struct>\n";
368 368
                 }
369 369
                 $charsetEncoder = $this->getCharsetEncoder();
370 370
                 /** @var Value $val2 */
371 371
                 foreach ($val as $key2 => $val2) {
372
-                    $rs .= '<member><name>' . $charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</name>\n";
372
+                    $rs .= '<member><name>'.$charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</name>\n";
373 373
                     $rs .= $val2->serialize($charsetEncoding);
374 374
                     $rs .= "</member>\n";
375 375
                 }
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
      */
584 584
     public function structMemExists($key)
585 585
     {
586
-        $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated');
586
+        $this->logDeprecation('Method '.__METHOD__.' is deprecated');
587 587
 
588 588
         return array_key_exists($key, $this->me['struct']);
589 589
     }
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
      */
600 600
     public function structMem($key)
601 601
     {
602
-        $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated');
602
+        $this->logDeprecation('Method '.__METHOD__.' is deprecated');
603 603
 
604 604
         return $this->me['struct'][$key];
605 605
     }
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
      */
613 613
     public function structReset()
614 614
     {
615
-        $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated');
615
+        $this->logDeprecation('Method '.__METHOD__.' is deprecated');
616 616
 
617 617
         reset($this->me['struct']);
618 618
     }
@@ -626,7 +626,7 @@  discard block
 block discarded – undo
626 626
      */
627 627
     public function structEach()
628 628
     {
629
-        $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated');
629
+        $this->logDeprecation('Method '.__METHOD__.' is deprecated');
630 630
 
631 631
         $key = key($this->me['struct']);
632 632
         $value = current($this->me['struct']);
@@ -645,7 +645,7 @@  discard block
 block discarded – undo
645 645
      */
646 646
     public function arrayMem($key)
647 647
     {
648
-        $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated');
648
+        $this->logDeprecation('Method '.__METHOD__.' is deprecated');
649 649
 
650 650
         return $this->me['array'][$key];
651 651
     }
@@ -659,7 +659,7 @@  discard block
 block discarded – undo
659 659
      */
660 660
     public function arraySize()
661 661
     {
662
-        $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated');
662
+        $this->logDeprecation('Method '.__METHOD__.' is deprecated');
663 663
 
664 664
         return count($this->me['array']);
665 665
     }
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
      */
674 674
     public function structSize()
675 675
     {
676
-        $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated');
676
+        $this->logDeprecation('Method '.__METHOD__.' is deprecated');
677 677
 
678 678
         return count($this->me['struct']);
679 679
     }
@@ -685,12 +685,12 @@  discard block
 block discarded – undo
685 685
             case 'me':
686 686
             case 'mytype':
687 687
             case '_php_class':
688
-                $this->logDeprecation('Getting property Value::' . $name . ' is deprecated');
688
+                $this->logDeprecation('Getting property Value::'.$name.' is deprecated');
689 689
                 return $this->$name;
690 690
             default:
691 691
                 /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
692 692
                 $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
693
-                trigger_error('Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING);
693
+                trigger_error('Undefined property via __get(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING);
694 694
                 $result = null;
695 695
                 return $result;
696 696
         }
@@ -702,13 +702,13 @@  discard block
 block discarded – undo
702 702
             case 'me':
703 703
             case 'mytype':
704 704
             case '_php_class':
705
-                $this->logDeprecation('Setting property Value::' . $name . ' is deprecated');
705
+                $this->logDeprecation('Setting property Value::'.$name.' is deprecated');
706 706
                 $this->$name = $value;
707 707
                 break;
708 708
             default:
709 709
                 /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
710 710
                 $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
711
-                trigger_error('Undefined property via __set(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING);
711
+                trigger_error('Undefined property via __set(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING);
712 712
         }
713 713
     }
714 714
 
@@ -718,7 +718,7 @@  discard block
 block discarded – undo
718 718
             case 'me':
719 719
             case 'mytype':
720 720
             case '_php_class':
721
-                $this->logDeprecation('Checking property Value::' . $name . ' is deprecated');
721
+                $this->logDeprecation('Checking property Value::'.$name.' is deprecated');
722 722
                 return isset($this->$name);
723 723
             default:
724 724
                 return false;
@@ -731,13 +731,13 @@  discard block
 block discarded – undo
731 731
             case 'me':
732 732
             case 'mytype':
733 733
             case '_php_class':
734
-                $this->logDeprecation('Unsetting property Value::' . $name . ' is deprecated');
734
+                $this->logDeprecation('Unsetting property Value::'.$name.' is deprecated');
735 735
                 unset($this->$name);
736 736
                 break;
737 737
             default:
738 738
                 /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
739 739
                 $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
740
-                trigger_error('Undefined property via __unset(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING);
740
+                trigger_error('Undefined property via __unset(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING);
741 741
         }
742 742
     }
743 743
 }
Please login to merge, or discard this patch.
lib/xmlrpcs.inc 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function echoInput()
56 56
     {
57
-        $r = new PhpXmlRpc\Response(new PhpXmlRpc\Value("'Aha said I: '" . file_get_contents('php://input'), 'string'));
57
+        $r = new PhpXmlRpc\Response(new PhpXmlRpc\Value("'Aha said I: '".file_get_contents('php://input'), 'string'));
58 58
         print $r->serialize();
59 59
     }
60 60
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function &__get($name)
67 67
     {
68
-        switch($name) {
68
+        switch ($name) {
69 69
             case 'dmap':
70 70
                 return $this->dmap;
71 71
             default:
@@ -96,30 +96,30 @@  discard block
 block discarded – undo
96 96
     Server::xmlrpc_debugmsg($m);
97 97
 }
98 98
 
99
-function _xmlrpcs_getCapabilities($server, $m=null)
99
+function _xmlrpcs_getCapabilities($server, $m = null)
100 100
 {
101 101
     return Server::_xmlrpcs_getCapabilities($server, $m);
102 102
 }
103 103
 
104
-$_xmlrpcs_listMethods_sig=array(array(\PhpXmlRpc\Value::$xmlrpcArray));
105
-$_xmlrpcs_listMethods_doc='This method lists all the methods that the XML-RPC server knows how to dispatch';
106
-$_xmlrpcs_listMethods_sdoc=array(array('list of method names'));
107
-function _xmlrpcs_listMethods($server, $m=null) // if called in plain php values mode, second param is missing
104
+$_xmlrpcs_listMethods_sig = array(array(\PhpXmlRpc\Value::$xmlrpcArray));
105
+$_xmlrpcs_listMethods_doc = 'This method lists all the methods that the XML-RPC server knows how to dispatch';
106
+$_xmlrpcs_listMethods_sdoc = array(array('list of method names'));
107
+function _xmlrpcs_listMethods($server, $m = null) // if called in plain php values mode, second param is missing
108 108
 {
109 109
     return Server::_xmlrpcs_listMethods($server, $m);
110 110
 }
111 111
 
112
-$_xmlrpcs_methodSignature_sig=array(array(\PhpXmlRpc\Value::$xmlrpcArray, $GLOBALS['xmlrpcString']));
113
-$_xmlrpcs_methodSignature_doc='Returns an array of known signatures (an array of arrays) for the method name passed. If no signatures are known, returns a none-array (test for type != array to detect missing signature)';
114
-$_xmlrpcs_methodSignature_sdoc=array(array('list of known signatures, each sig being an array of xmlrpc type names', 'name of method to be described'));
112
+$_xmlrpcs_methodSignature_sig = array(array(\PhpXmlRpc\Value::$xmlrpcArray, $GLOBALS['xmlrpcString']));
113
+$_xmlrpcs_methodSignature_doc = 'Returns an array of known signatures (an array of arrays) for the method name passed. If no signatures are known, returns a none-array (test for type != array to detect missing signature)';
114
+$_xmlrpcs_methodSignature_sdoc = array(array('list of known signatures, each sig being an array of xmlrpc type names', 'name of method to be described'));
115 115
 function _xmlrpcs_methodSignature($server, $m)
116 116
 {
117 117
     return Server::_xmlrpcs_methodSignature($server, $m);
118 118
 }
119 119
 
120
-$_xmlrpcs_methodHelp_sig=array(array($GLOBALS['xmlrpcString'], $GLOBALS['xmlrpcString']));
121
-$_xmlrpcs_methodHelp_doc='Returns help text if defined for the method passed, otherwise returns an empty string';
122
-$_xmlrpcs_methodHelp_sdoc=array(array('method description', 'name of the method to be described'));
120
+$_xmlrpcs_methodHelp_sig = array(array($GLOBALS['xmlrpcString'], $GLOBALS['xmlrpcString']));
121
+$_xmlrpcs_methodHelp_doc = 'Returns help text if defined for the method passed, otherwise returns an empty string';
122
+$_xmlrpcs_methodHelp_sdoc = array(array('method description', 'name of the method to be described'));
123 123
 function _xmlrpcs_methodHelp($server, $m)
124 124
 {
125 125
     return Server::_xmlrpcs_methodHelp($server, $m);
Please login to merge, or discard this patch.
src/Encoder.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
                                 'scalar' => $val,
58 58
                                 'timestamp' => \PhpXmlRpc\Helper\Date::iso8601Decode($val)
59 59
                             );
60
-                            return (object)$xmlrpcVal;
60
+                            return (object) $xmlrpcVal;
61 61
                         case 'base64':
62 62
                             $xmlrpcVal = array(
63 63
                                 'xmlrpc_type' => 'base64',
64 64
                                 'scalar' => $val
65 65
                             );
66
-                            return (object)$xmlrpcVal;
66
+                            return (object) $xmlrpcVal;
67 67
                         case 'string':
68 68
                             if (isset($options['extension_api_encoding'])) {
69 69
                                 // if iconv is not available, we use mb_convert_encoding
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
             case 'msg':
137 137
                 $paramCount = $xmlrpcVal->getNumParams();
138 138
                 $arr = array();
139
-                for ($i = 0; $i < $paramCount; $i++) {
139
+                for ($i = 0; $i<$paramCount; $i++) {
140 140
                     $arr[] = $this->decode($xmlrpcVal->getParam($i), $options);
141 141
                 }
142 142
                 return $arr;
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
                 break;
262 262
             case 'resource':
263 263
                 if (in_array('extension_api', $options)) {
264
-                    $xmlrpcVal = new Value((int)$phpVal, Value::$xmlrpcInt);
264
+                    $xmlrpcVal = new Value((int) $phpVal, Value::$xmlrpcInt);
265 265
                 } else {
266 266
                     $xmlrpcVal = new Value();
267 267
                 }
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
                     if ($valEncoding == 'ISO-8859-1') {
311 311
                         $xmlVal = utf8_encode($xmlVal);
312 312
                     } else {
313
-                        $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': invalid charset encoding of xml text: ' . $valEncoding);
313
+                        $this->getLogger()->error('XML-RPC: '.__METHOD__.': invalid charset encoding of xml text: '.$valEncoding);
314 314
                     }
315 315
                 }
316 316
             }
@@ -336,10 +336,10 @@  discard block
 block discarded – undo
336 336
             $_xh = $xmlRpcParser->_xh;
337 337
         }
338 338
 
339
-        if ($_xh['isf'] > 1) {
339
+        if ($_xh['isf']>1) {
340 340
             // test that $_xh['value'] is an obj, too???
341 341
 
342
-            $this->getLogger()->error('XML-RPC: ' . $_xh['isf_reason']);
342
+            $this->getLogger()->error('XML-RPC: '.$_xh['isf_reason']);
343 343
 
344 344
             return false;
345 345
         }
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 
361 361
             case 'methodcall':
362 362
                 $req = new Request($_xh['method']);
363
-                for ($i = 0; $i < count($_xh['params']); $i++) {
363
+                for ($i = 0; $i<count($_xh['params']); $i++) {
364 364
                     $req->addParam($_xh['params'][$i]);
365 365
                 }
366 366
                 return $req;
Please login to merge, or discard this patch.
demo/vardemo.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ . "/client/_prepend.php";
2
+require_once __DIR__."/client/_prepend.php";
3 3
 
4 4
 output('<html lang="en">
5 5
 <head><title>phpxmlrpc</title></head>
@@ -10,25 +10,25 @@  discard block
 block discarded – undo
10 10
 output("<p>Please note that in most cases you are better off using `new PhpXmlRpc\Encoder()->encode()` to create nested Value objects</p>\n");
11 11
 
12 12
 $v = new PhpXmlRpc\Value(1234, 'int');
13
-output("Int: <PRE>" . htmlentities($v->serialize()) . "</PRE>");
13
+output("Int: <PRE>".htmlentities($v->serialize())."</PRE>");
14 14
 
15 15
 $v = new PhpXmlRpc\Value('Are the following characters escaped? < & >');
16
-output("String <PRE>" . htmlentities($v->serialize()) . "</PRE>");
16
+output("String <PRE>".htmlentities($v->serialize())."</PRE>");
17 17
 
18 18
 $v = new PhpXmlRpc\Value(true, 'boolean');
19
-output("Boolean: <PRE>" . htmlentities($v->serialize()) . "</PRE>");
19
+output("Boolean: <PRE>".htmlentities($v->serialize())."</PRE>");
20 20
 
21 21
 $v = new PhpXmlRpc\Value(1234.5678, 'double');
22
-output("Double: <PRE>" . htmlentities($v->serialize()) . "</PRE>");
22
+output("Double: <PRE>".htmlentities($v->serialize())."</PRE>");
23 23
 
24 24
 $v = new PhpXmlRpc\Value(time(), 'dateTime.iso8601');
25
-output("Datetime (from timestamp): <PRE>" . htmlentities($v->serialize()) . "</PRE>");
25
+output("Datetime (from timestamp): <PRE>".htmlentities($v->serialize())."</PRE>");
26 26
 $v = new PhpXmlRpc\Value(new DateTime(), 'dateTime.iso8601');
27
-output("Datetime (from php DateTime): <PRE>" . htmlentities($v->serialize()) . "</PRE>");
27
+output("Datetime (from php DateTime): <PRE>".htmlentities($v->serialize())."</PRE>");
28 28
 
29 29
 $v = new PhpXmlRpc\Value('hello world', 'base64');
30
-output("Base64: <PRE>" . htmlentities($v->serialize()) . "</PRE>");
31
-output("(value of base64 string is: '" . $v->scalarVal() . "')<BR><BR>");
30
+output("Base64: <PRE>".htmlentities($v->serialize())."</PRE>");
31
+output("(value of base64 string is: '".$v->scalarVal()."')<BR><BR>");
32 32
 
33 33
 $v = new PhpXmlRpc\Value(
34 34
     array(
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     ),
42 42
     "array"
43 43
 );
44
-output("Array: <PRE>" . htmlentities($v->serialize()) . "</PRE>");
44
+output("Array: <PRE>".htmlentities($v->serialize())."</PRE>");
45 45
 
46 46
 $v = new PhpXmlRpc\Value(
47 47
     array(
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
     ),
62 62
     "struct"
63 63
 );
64
-output("Struct: <PRE>" . htmlentities($v->serialize()) . "</PRE>");
64
+output("Struct: <PRE>".htmlentities($v->serialize())."</PRE>");
65 65
 
66 66
 $w = new PhpXmlRpc\Value(array($v), 'array');
67
-output("Array containing a struct: <PRE>" . htmlentities($w->serialize()) . "</PRE>");
67
+output("Array containing a struct: <PRE>".htmlentities($w->serialize())."</PRE>");
68 68
 
69 69
 class MyClass
70 70
 {
@@ -76,49 +76,49 @@  discard block
 block discarded – undo
76 76
 // the public property is the only one which will be serialized. As such, it has to be of type Value
77 77
 $myObject->public = new \PhpXmlRpc\Value('a public property, wrapped');
78 78
 $w = new PhpXmlRpc\Value($myObject, 'struct');
79
-output("Struct encoding a php object: <PRE>" . htmlentities($w->serialize()) . "</PRE>");
79
+output("Struct encoding a php object: <PRE>".htmlentities($w->serialize())."</PRE>");
80 80
 
81 81
 output("<h3>Testing value serialization - xml-rpc extensions</h3>\n");
82 82
 $v = new PhpXmlRpc\Value(1234, 'i8');
83
-output("I8: <PRE>" . htmlentities($v->serialize()) . "</PRE>");
83
+output("I8: <PRE>".htmlentities($v->serialize())."</PRE>");
84 84
 $v = new PhpXmlRpc\Value(null, 'null');
85
-output("Null: <PRE>" . htmlentities($v->serialize()) . "</PRE>");
85
+output("Null: <PRE>".htmlentities($v->serialize())."</PRE>");
86 86
 \PhpXmlRpc\PhpXmlRpc::$xmlrpc_null_apache_encoding = true;
87
-output("Null, alternative: <PRE>" . htmlentities($v->serialize()) . "</PRE>");
87
+output("Null, alternative: <PRE>".htmlentities($v->serialize())."</PRE>");
88 88
 
89 89
 output("<h3>Testing value serialization - character encoding</h3>\n");
90 90
 // The greek word 'kosme'
91 91
 $v = new PhpXmlRpc\Value('κόσμε');
92
-output("Greek (default encoding): <PRE>" . htmlentities($v->serialize()) . "</PRE>");
93
-output("Greek (utf8 encoding): <PRE>" . htmlentities($v->serialize('UTF-8')) . "</PRE>");
92
+output("Greek (default encoding): <PRE>".htmlentities($v->serialize())."</PRE>");
93
+output("Greek (utf8 encoding): <PRE>".htmlentities($v->serialize('UTF-8'))."</PRE>");
94 94
 if (function_exists('mb_convert_encoding')) {
95
-    output("Greek (ISO-8859-7 encoding): <PRE>" . htmlentities($v->serialize('ISO-8859-7')) . "</PRE>");
95
+    output("Greek (ISO-8859-7 encoding): <PRE>".htmlentities($v->serialize('ISO-8859-7'))."</PRE>");
96 96
 }
97 97
 
98 98
 output("<h3>Testing request serialization</h3>\n");
99 99
 $req = new PhpXmlRpc\Request('examples.getStateName');
100 100
 $req->method('examples.getStateName');
101 101
 $req->addParam(new PhpXmlRpc\Value(42, 'int'));
102
-output("<PRE>" . htmlentities($req->serialize()) . "</PRE>");
102
+output("<PRE>".htmlentities($req->serialize())."</PRE>");
103 103
 
104 104
 output("<h3>Testing response serialization</h3>\n");
105 105
 $resp = new PhpXmlRpc\Response(new PhpXmlRpc\Value('The meaning of life'));
106
-output("<PRE>" . htmlentities($resp->serialize()) . "</PRE>");
106
+output("<PRE>".htmlentities($resp->serialize())."</PRE>");
107 107
 
108 108
 output("<h3>Testing ISO date formatting</h3><pre>\n");
109 109
 $t = time();
110 110
 $date = PhpXmlRpc\Helper\Date::iso8601Encode($t);
111 111
 output("Now is $t --> $date\n");
112
-output("Or in UTC, that is " . PhpXmlRpc\Helper\Date::iso8601Encode($t, 1) . "\n");
112
+output("Or in UTC, that is ".PhpXmlRpc\Helper\Date::iso8601Encode($t, 1)."\n");
113 113
 $tb = PhpXmlRpc\Helper\Date::iso8601Decode($date);
114 114
 output("That is to say $date --> $tb\n");
115
-output("Which comes out at " . PhpXmlRpc\Helper\Date::iso8601Encode($tb) . "\n");
116
-output("Which was the time in UTC at " . PhpXmlRpc\Helper\Date::iso8601Encode($tb, 1) . "\n");
115
+output("Which comes out at ".PhpXmlRpc\Helper\Date::iso8601Encode($tb)."\n");
116
+output("Which was the time in UTC at ".PhpXmlRpc\Helper\Date::iso8601Encode($tb, 1)."\n");
117 117
 output("</pre>\n");
118 118
 
119 119
 output("<h3>Testing reduced-precision formatting for doubles</h3><pre>\n");
120 120
 $v = new PhpXmlRpc\Value(1234.56789, 'double');
121 121
 \PhpXmlRpc\PhpXmlRpc::$xmlpc_double_precision = 2;
122
-output("Double, limited precision: <PRE>" . htmlentities($v->serialize()) . "</PRE>");
122
+output("Double, limited precision: <PRE>".htmlentities($v->serialize())."</PRE>");
123 123
 
124 124
 output('</body></html>');
Please login to merge, or discard this patch.
demo/client/getstatename.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ . "/_prepend.php";
2
+require_once __DIR__."/_prepend.php";
3 3
 
4 4
 output('<html lang="en">
5 5
 <head><title>phpxmlrpc - Getstatename demo</title></head>
@@ -17,13 +17,13 @@  discard block
 block discarded – undo
17 17
 $stateNo = "";
18 18
 
19 19
 if (isset($_POST['stateno']) && $_POST['stateno'] != "") {
20
-    $stateNo = (integer)$_POST['stateno'];
20
+    $stateNo = (integer) $_POST['stateno'];
21 21
     $method = 'examples.getStateName';
22 22
     $arguments = array(
23 23
         new Value($stateNo, Value::$xmlrpcInt),
24 24
     );
25 25
     $req = new Request($method, $arguments);
26
-    output("Sending the following request:<pre>\n\n" . htmlentities($req->serialize()) .
26
+    output("Sending the following request:<pre>\n\n".htmlentities($req->serialize()).
27 27
         "\n\n</pre>Debug info of server data follows...\n\n");
28 28
     $client = new Client(XMLRPCSERVER);
29 29
     $client->setOption(Client::OPT_DEBUG, 1);
@@ -32,12 +32,12 @@  discard block
 block discarded – undo
32 32
         $val = $resp->value();
33 33
         // NB: we are _assuming_ that the server did return a scalar xml-rpc value here.
34 34
         // If the server is not trusted, we might check that via `$val->kindOf() == 'scalar'`
35
-        output('<br/>State number <b>' . $stateNo . '</b> is <b>'
36
-            . htmlspecialchars($val->scalarVal()) . '</b><br/><br/>');
35
+        output('<br/>State number <b>'.$stateNo.'</b> is <b>'
36
+            . htmlspecialchars($val->scalarVal()).'</b><br/><br/>');
37 37
     } else {
38 38
         output('An error occurred: ');
39
-        output('<pre>Code: ' . htmlspecialchars($resp->faultCode())
40
-            . " Reason: '" . htmlspecialchars($resp->faultString()) . "'</pre>");
39
+        output('<pre>Code: '.htmlspecialchars($resp->faultCode())
40
+            . " Reason: '".htmlspecialchars($resp->faultString())."'</pre>");
41 41
     }
42 42
 }
43 43
 
Please login to merge, or discard this patch.
demo/server/proxy.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
  * @license code licensed under the BSD License: see file license.txt
17 17
  */
18 18
 
19
-require_once __DIR__ . "/_prepend.php";
19
+require_once __DIR__."/_prepend.php";
20 20
 
21 21
 // *** NB: WE BLOCK THIS FROM RUNNING BY DEFAULT IN CASE ACCESS IS GRANTED TO IT IN PRODUCTION BY MISTAKE ***
22 22
 // Comment out the following safeguard if you want to use it as is, but remember: this is an open relay !!!
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
     //            fe. any url using the 'file://' protocol might be considered a hacking attempt
48 48
     $client = new Client($url);
49 49
 
50
-    if ($req->getNumParams() > 3) {
50
+    if ($req->getNumParams()>3) {
51 51
         // We have to set some options onto the client.
52 52
         // Note that if we do not untaint the received values, warnings might be generated...
53 53
         $options = $encoder->decode($req->getParam(3));
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
                     $client->setOption(Client::OPT_VERIFY_PEER, $val);
88 88
                     break;
89 89
                 case 'Timeout':
90
-                    $timeout = (integer)$val;
90
+                    $timeout = (integer) $val;
91 91
                     break;
92 92
             } // switch
93 93
         }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
     ///         X-forwarded-for anyway, unless they consider this server as trusted...)
101 101
     $reqMethod = $req->getParam(1)->scalarVal();
102 102
     $req = new Request($reqMethod);
103
-    if ($req->getNumParams() > 1) {
103
+    if ($req->getNumParams()>1) {
104 104
         $pars = $req->getParam(2);
105 105
         foreach ($pars as $par) {
106 106
             $req->addParam($par);
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
     }
109 109
 
110 110
     // add debug info into response we give back to caller
111
-    Server::xmlrpc_debugmsg("Sending to server $url the payload: " . $req->serialize());
111
+    Server::xmlrpc_debugmsg("Sending to server $url the payload: ".$req->serialize());
112 112
 
113 113
     return $client->send($req, $timeout);
114 114
 }
Please login to merge, or discard this patch.