Passed
Push — master ( 2f0bfc...2c4b96 )
by Gaetano
13:05
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.
src/Helper/XMLParser.php 1 patch
Spacing   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -187,12 +187,12 @@  discard block
 block discarded – undo
187 187
             // q: can php be built without ctype? should we use a regexp?
188 188
             if (is_string($key) && !ctype_digit($key)) {
189 189
                 /// @todo on invalid options, throw/error-out instead of logging an error message?
190
-                switch($key) {
190
+                switch ($key) {
191 191
                     case 'target_charset':
192 192
                         if (function_exists('mb_convert_encoding')) {
193 193
                             $this->current_parsing_options['target_charset'] = $val;
194 194
                         } else {
195
-                            $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ": 'target_charset' option is unsupported without mbstring");
195
+                            $this->getLogger()->error('XML-RPC: '.__METHOD__.": 'target_charset' option is unsupported without mbstring");
196 196
                         }
197 197
                         break;
198 198
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
                         if (is_callable($val)) {
201 201
                             $this->current_parsing_options['methodname_callback'] = $val;
202 202
                         } else {
203
-                            $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ": Callback passed as 'methodname_callback' is not callable");
203
+                            $this->getLogger()->error('XML-RPC: '.__METHOD__.": Callback passed as 'methodname_callback' is not callable");
204 204
                         }
205 205
                         break;
206 206
 
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
                         break;
212 212
 
213 213
                     default:
214
-                        $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ": unsupported option: $key");
214
+                        $this->getLogger()->error('XML-RPC: '.__METHOD__.": unsupported option: $key");
215 215
                 }
216 216
                 unset($mergedOptions[$key]);
217 217
             }
@@ -257,10 +257,10 @@  discard block
 block discarded – undo
257 257
 
258 258
         try {
259 259
             // @see ticket #70 - we have to parse big xml docs in chunks to avoid errors
260
-            for ($offset = 0; $offset < $len; $offset += $this->maxChunkLength) {
260
+            for ($offset = 0; $offset<$len; $offset += $this->maxChunkLength) {
261 261
                 $chunk = substr($data, $offset, $this->maxChunkLength);
262 262
                 // error handling: xml not well formed
263
-                if (!xml_parse($parser, $chunk, $offset + $this->maxChunkLength >= $len)) {
263
+                if (!xml_parse($parser, $chunk, $offset+$this->maxChunkLength>=$len)) {
264 264
                     $errCode = xml_get_error_code($parser);
265 265
                     $errStr = sprintf('XML error %s: %s at line %d, column %d', $errCode, xml_error_string($errCode),
266 266
                         xml_get_current_line_number($parser), xml_get_current_column_number($parser));
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
                     $this->_xh['isf_reason'] = $errStr;
270 270
                 }
271 271
                 // no need to parse further if we already have a fatal error
272
-                if ($this->_xh['isf'] >= 2) {
272
+                if ($this->_xh['isf']>=2) {
273 273
                     break;
274 274
                 }
275 275
             }
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
     public function xmlrpc_se($parser, $name, $attrs, $acceptSingleVals = false)
310 310
     {
311 311
         // if invalid xml-rpc already detected, skip all processing
312
-        if ($this->_xh['isf'] >= 2) {
312
+        if ($this->_xh['isf']>=2) {
313 313
             return;
314 314
         }
315 315
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
             if ($acceptSingleVals === false) {
324 324
                 $accept = $this->current_parsing_options['accept'];
325 325
             } else {
326
-                $this->logDeprecation('Using argument $acceptSingleVals for method ' . __METHOD__ . ' is deprecated');
326
+                $this->logDeprecation('Using argument $acceptSingleVals for method '.__METHOD__.' is deprecated');
327 327
                 $accept = self::ACCEPT_REQUEST | self::ACCEPT_RESPONSE | self::ACCEPT_VALUE;
328 328
             }
329 329
             if (($name == 'METHODCALL' && ($accept & self::ACCEPT_REQUEST)) ||
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
                 $this->_xh['rt'] = strtolower($name);
334 334
             } else {
335 335
                 $this->_xh['isf'] = 2;
336
-                $this->_xh['isf_reason'] = 'missing top level xmlrpc element. Found: ' . $name;
336
+                $this->_xh['isf_reason'] = 'missing top level xmlrpc element. Found: '.$name;
337 337
 
338 338
                 return;
339 339
             }
@@ -435,7 +435,7 @@  discard block
 block discarded – undo
435 435
 
436 436
             case 'MEMBER':
437 437
                 // set member name to null, in case we do not find in the xml later on
438
-                $this->_xh['valuestack'][count($this->_xh['valuestack']) - 1]['name'] = null;
438
+                $this->_xh['valuestack'][count($this->_xh['valuestack'])-1]['name'] = null;
439 439
                 //$this->_xh['ac']='';
440 440
                 // Drop trough intentionally
441 441
 
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
      */
499 499
     public function xmlrpc_ee($parser, $name, $rebuildXmlrpcvals = 1)
500 500
     {
501
-        if ($this->_xh['isf'] >= 2) {
501
+        if ($this->_xh['isf']>=2) {
502 502
             return;
503 503
         }
504 504
 
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
                     $this->_xh['value'] = mb_convert_encoding($this->_xh['value'], $this->current_parsing_options['target_charset'], 'UTF-8');
521 521
                 }
522 522
 
523
-                if ($rebuildXmlrpcvals > 0) {
523
+                if ($rebuildXmlrpcvals>0) {
524 524
                     // build the xml-rpc val out of the data received, and substitute it
525 525
                     $temp = new Value($this->_xh['value'], $this->_xh['vt']);
526 526
                     // in case we got info about underlying php class, save it in the object we're rebuilding
@@ -528,15 +528,15 @@  discard block
 block discarded – undo
528 528
                         $temp->_php_class = $this->_xh['php_class'];
529 529
                     }
530 530
                     $this->_xh['value'] = $temp;
531
-                } elseif ($rebuildXmlrpcvals < 0) {
531
+                } elseif ($rebuildXmlrpcvals<0) {
532 532
                     if ($this->_xh['vt'] == Value::$xmlrpcDateTime) {
533
-                        $this->_xh['value'] = (object)array(
533
+                        $this->_xh['value'] = (object) array(
534 534
                             'xmlrpc_type' => 'datetime',
535 535
                             'scalar' => $this->_xh['value'],
536 536
                             'timestamp' => \PhpXmlRpc\Helper\Date::iso8601Decode($this->_xh['value'])
537 537
                         );
538 538
                     } elseif ($this->_xh['vt'] == Value::$xmlrpcBase64) {
539
-                        $this->_xh['value'] = (object)array(
539
+                        $this->_xh['value'] = (object) array(
540 540
                             'xmlrpc_type' => 'base64',
541 541
                             'scalar' => $this->_xh['value']
542 542
                         );
@@ -551,8 +551,8 @@  discard block
 block discarded – undo
551 551
                 // check if we are inside an array or struct:
552 552
                 // if value just built is inside an array, let's move it into array on the stack
553 553
                 $vscount = count($this->_xh['valuestack']);
554
-                if ($vscount && $this->_xh['valuestack'][$vscount - 1]['type'] == 'ARRAY') {
555
-                    $this->_xh['valuestack'][$vscount - 1]['values'][] = $this->_xh['value'];
554
+                if ($vscount && $this->_xh['valuestack'][$vscount-1]['type'] == 'ARRAY') {
555
+                    $this->_xh['valuestack'][$vscount-1]['values'][] = $this->_xh['value'];
556 556
                 }
557 557
                 break;
558 558
 
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
                     // log if receiving something strange, even though we set the value to false anyway
580 580
                     /// @todo to be consistent with the other types, we should return a value outside the good-value domain, e.g. NULL
581 581
                     if ($this->_xh['ac'] != '0' && strcasecmp($this->_xh['ac'], 'false') !== 0) {
582
-                        if (!$this->handleParsingError('invalid data received in BOOLEAN value: ' .
582
+                        if (!$this->handleParsingError('invalid data received in BOOLEAN value: '.
583 583
                             $this->truncateValueForLog($this->_xh['ac']), __METHOD__)) {
584 584
                             return;
585 585
                         }
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
                 $this->_xh['vt'] = strtolower($name);
600 600
                 $this->_xh['lv'] = 3; // indicate we've found a value
601 601
                 if (!preg_match(PhpXmlRpc::$xmlrpc_int_format, $this->_xh['ac'])) {
602
-                    if (!$this->handleParsingError('non numeric data received in INT value: ' .
602
+                    if (!$this->handleParsingError('non numeric data received in INT value: '.
603 603
                         $this->truncateValueForLog($this->_xh['ac']), __METHOD__)) {
604 604
                         return;
605 605
                     }
@@ -607,7 +607,7 @@  discard block
 block discarded – undo
607 607
                     $this->_xh['value'] = 'ERROR_NON_NUMERIC_FOUND';
608 608
                 } else {
609 609
                     // it's ok, add it on
610
-                    $this->_xh['value'] = (int)$this->_xh['ac'];
610
+                    $this->_xh['value'] = (int) $this->_xh['ac'];
611 611
                 }
612 612
                 break;
613 613
 
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
                 $this->_xh['vt'] = Value::$xmlrpcDouble;
616 616
                 $this->_xh['lv'] = 3; // indicate we've found a value
617 617
                 if (!preg_match(PhpXmlRpc::$xmlrpc_double_format, $this->_xh['ac'])) {
618
-                    if (!$this->handleParsingError('non numeric data received in DOUBLE value: ' .
618
+                    if (!$this->handleParsingError('non numeric data received in DOUBLE value: '.
619 619
                         $this->truncateValueForLog($this->_xh['ac']), __METHOD__)) {
620 620
                         return;
621 621
                     }
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
                     $this->_xh['value'] = 'ERROR_NON_NUMERIC_FOUND';
624 624
                 } else {
625 625
                     // it's ok, add it on
626
-                    $this->_xh['value'] = (double)$this->_xh['ac'];
626
+                    $this->_xh['value'] = (double) $this->_xh['ac'];
627 627
                 }
628 628
                 break;
629 629
 
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
                 $this->_xh['vt'] = Value::$xmlrpcDateTime;
632 632
                 $this->_xh['lv'] = 3; // indicate we've found a value
633 633
                 if (!preg_match(PhpXmlRpc::$xmlrpc_datetime_format, $this->_xh['ac'])) {
634
-                    if (!$this->handleParsingError('invalid data received in DATETIME value: ' .
634
+                    if (!$this->handleParsingError('invalid data received in DATETIME value: '.
635 635
                         $this->truncateValueForLog($this->_xh['ac']), __METHOD__)) {
636 636
                         return;
637 637
                     }
@@ -642,9 +642,9 @@  discard block
 block discarded – undo
642 642
 
643 643
                     // the default regex used to validate the date string a few lines above should make this case impossible,
644 644
                     // but one never knows...
645
-                    } catch(\Exception $e) {
645
+                    } catch (\Exception $e) {
646 646
                         // what to do? We can not guarantee that a valid date can be created. We return null...
647
-                        if (!$this->handleParsingError('invalid data received in DATETIME value. Error ' .
647
+                        if (!$this->handleParsingError('invalid data received in DATETIME value. Error '.
648 648
                             $e->getMessage(), __METHOD__)) {
649 649
                             return;
650 650
                         }
@@ -661,14 +661,14 @@  discard block
 block discarded – undo
661 661
                     $v = base64_decode($this->_xh['ac'], true);
662 662
                     if ($v === false) {
663 663
                         $this->_xh['isf'] = 2;
664
-                        $this->_xh['isf_reason'] = 'Invalid data received in BASE64 value: '. $this->truncateValueForLog($this->_xh['ac']);
664
+                        $this->_xh['isf_reason'] = 'Invalid data received in BASE64 value: '.$this->truncateValueForLog($this->_xh['ac']);
665 665
                         return;
666 666
                     }
667 667
                 } else {
668 668
                     $v = base64_decode($this->_xh['ac']);
669 669
                     if ($v === '' && $this->_xh['ac'] !== '') {
670 670
                         // only the empty string should decode to the empty string
671
-                        $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': invalid data received in BASE64 value: ' .
671
+                        $this->getLogger()->error('XML-RPC: '.__METHOD__.': invalid data received in BASE64 value: '.
672 672
                             $this->truncateValueForLog($this->_xh['ac']));
673 673
                     }
674 674
                 }
@@ -676,20 +676,20 @@  discard block
 block discarded – undo
676 676
                 break;
677 677
 
678 678
             case 'NAME':
679
-                $this->_xh['valuestack'][count($this->_xh['valuestack']) - 1]['name'] = $this->_xh['ac'];
679
+                $this->_xh['valuestack'][count($this->_xh['valuestack'])-1]['name'] = $this->_xh['ac'];
680 680
                 break;
681 681
 
682 682
             case 'MEMBER':
683 683
                 // add to array in the stack the last element built, unless no VALUE or no NAME were found
684 684
                 if ($this->_xh['vt']) {
685 685
                     $vscount = count($this->_xh['valuestack']);
686
-                    if ($this->_xh['valuestack'][$vscount - 1]['name'] === null) {
686
+                    if ($this->_xh['valuestack'][$vscount-1]['name'] === null) {
687 687
                         if (!$this->handleParsingError('missing NAME inside STRUCT in received xml', __METHOD__)) {
688 688
                             return;
689 689
                         }
690
-                        $this->_xh['valuestack'][$vscount - 1]['name'] = '';
690
+                        $this->_xh['valuestack'][$vscount-1]['name'] = '';
691 691
                     }
692
-                    $this->_xh['valuestack'][$vscount - 1]['values'][$this->_xh['valuestack'][$vscount - 1]['name']] = $this->_xh['value'];
692
+                    $this->_xh['valuestack'][$vscount-1]['values'][$this->_xh['valuestack'][$vscount-1]['name']] = $this->_xh['value'];
693 693
                 } else {
694 694
                     if (!$this->handleParsingError('missing VALUE inside STRUCT in received xml', __METHOD__)) {
695 695
                         return;
@@ -805,7 +805,7 @@  discard block
 block discarded – undo
805 805
     public function xmlrpc_cd($parser, $data)
806 806
     {
807 807
         // skip processing if xml fault already detected
808
-        if ($this->_xh['isf'] >= 2) {
808
+        if ($this->_xh['isf']>=2) {
809 809
             return;
810 810
         }
811 811
 
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
     public function xmlrpc_dh($parser, $data)
828 828
     {
829 829
         // skip processing if xml fault already detected
830
-        if ($this->_xh['isf'] >= 2) {
830
+        if ($this->_xh['isf']>=2) {
831 831
             return;
832 832
         }
833 833
 
@@ -903,8 +903,8 @@  discard block
 block discarded – undo
903 903
         // Details:
904 904
         // SPACE:         (#x20 | #x9 | #xD | #xA)+ === [ \x9\xD\xA]+
905 905
         // EQ:            SPACE?=SPACE? === [ \x9\xD\xA]*=[ \x9\xD\xA]*
906
-        if (preg_match('/^<\?xml\s+version\s*=\s*' . "((?:\"[a-zA-Z0-9_.:-]+\")|(?:'[a-zA-Z0-9_.:-]+'))" .
907
-            '\s+encoding\s*=\s*' . "((?:\"[A-Za-z][A-Za-z0-9._-]*\")|(?:'[A-Za-z][A-Za-z0-9._-]*'))/",
906
+        if (preg_match('/^<\?xml\s+version\s*=\s*'."((?:\"[a-zA-Z0-9_.:-]+\")|(?:'[a-zA-Z0-9_.:-]+'))".
907
+            '\s+encoding\s*=\s*'."((?:\"[A-Za-z][A-Za-z0-9._-]*\")|(?:'[A-Za-z][A-Za-z0-9._-]*'))/",
908 908
             $xmlChunk, $matches)) {
909 909
             return strtoupper(substr($matches[2], 1, -1));
910 910
         }
@@ -922,7 +922,7 @@  discard block
 block discarded – undo
922 922
             // NB: mb_detect likes to call it ascii, xml parser likes to call it US_ASCII...
923 923
             // IANA also likes better US-ASCII, so go with it
924 924
             if ($enc == 'ASCII') {
925
-                $enc = 'US-' . $enc;
925
+                $enc = 'US-'.$enc;
926 926
             }
927 927
 
928 928
             return $enc;
@@ -959,8 +959,8 @@  discard block
 block discarded – undo
959 959
         // Details:
960 960
         // SPACE:         (#x20 | #x9 | #xD | #xA)+ === [ \x9\xD\xA]+
961 961
         // EQ:            SPACE?=SPACE? === [ \x9\xD\xA]*=[ \x9\xD\xA]*
962
-        if (preg_match('/^<\?xml\s+version\s*=\s*' . "((?:\"[a-zA-Z0-9_.:-]+\")|(?:'[a-zA-Z0-9_.:-]+'))" .
963
-            '\s+encoding\s*=\s*' . "((?:\"[A-Za-z][A-Za-z0-9._-]*\")|(?:'[A-Za-z][A-Za-z0-9._-]*'))/",
962
+        if (preg_match('/^<\?xml\s+version\s*=\s*'."((?:\"[a-zA-Z0-9_.:-]+\")|(?:'[a-zA-Z0-9_.:-]+'))".
963
+            '\s+encoding\s*=\s*'."((?:\"[A-Za-z][A-Za-z0-9._-]*\")|(?:'[A-Za-z][A-Za-z0-9._-]*'))/",
964 964
             $xmlChunk)) {
965 965
             return true;
966 966
         }
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
             $this->_xh['isf_reason'] = ucfirst($message);
981 981
             return false;
982 982
         } else {
983
-            $this->getLogger()->error('XML-RPC: ' . ($method != '' ? $method . ': ' : '') . $message);
983
+            $this->getLogger()->error('XML-RPC: '.($method != '' ? $method.': ' : '').$message);
984 984
             return true;
985 985
         }
986 986
     }
@@ -992,8 +992,8 @@  discard block
 block discarded – undo
992 992
      */
993 993
     protected function truncateValueForLog($data)
994 994
     {
995
-        if (strlen($data) > $this->maxLogValueLength) {
996
-            return substr($data, 0, $this->maxLogValueLength - 3) . '...';
995
+        if (strlen($data)>$this->maxLogValueLength) {
996
+            return substr($data, 0, $this->maxLogValueLength-3).'...';
997 997
         }
998 998
 
999 999
         return $data;
@@ -1014,7 +1014,7 @@  discard block
 block discarded – undo
1014 1014
     public function xmlrpc_se_any($parser, $name, $attrs)
1015 1015
     {
1016 1016
         // this will be spamming the log if this method is in use...
1017
-        $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated');
1017
+        $this->logDeprecation('Method '.__METHOD__.' is deprecated');
1018 1018
 
1019 1019
         $this->xmlrpc_se($parser, $name, $attrs, true);
1020 1020
     }
@@ -1024,12 +1024,12 @@  discard block
 block discarded – undo
1024 1024
         switch ($name) {
1025 1025
             case '_xh':
1026 1026
             case 'xmlrpc_valid_parents':
1027
-                $this->logDeprecation('Getting property XMLParser::' . $name . ' is deprecated');
1027
+                $this->logDeprecation('Getting property XMLParser::'.$name.' is deprecated');
1028 1028
                 return $this->$name;
1029 1029
             default:
1030 1030
                 /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
1031 1031
                 $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
1032
-                trigger_error('Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING);
1032
+                trigger_error('Undefined property via __get(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING);
1033 1033
                 $result = null;
1034 1034
                 return $result;
1035 1035
         }
@@ -1040,18 +1040,18 @@  discard block
 block discarded – undo
1040 1040
         switch ($name) {
1041 1041
             // this should only ever be called by subclasses which overtook `parse()`
1042 1042
             case 'accept':
1043
-                $this->logDeprecation('Setting property XMLParser::' . $name . ' is deprecated');
1043
+                $this->logDeprecation('Setting property XMLParser::'.$name.' is deprecated');
1044 1044
                 $this->current_parsing_options['accept'] = $value;
1045 1045
                 break;
1046 1046
             case '_xh':
1047 1047
             case 'xmlrpc_valid_parents':
1048
-                $this->logDeprecation('Setting property XMLParser::' . $name . ' is deprecated');
1048
+                $this->logDeprecation('Setting property XMLParser::'.$name.' is deprecated');
1049 1049
                 $this->$name = $value;
1050 1050
                 break;
1051 1051
             default:
1052 1052
                 /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
1053 1053
                 $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
1054
-                trigger_error('Undefined property via __set(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING);
1054
+                trigger_error('Undefined property via __set(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING);
1055 1055
         }
1056 1056
     }
1057 1057
 
@@ -1059,11 +1059,11 @@  discard block
 block discarded – undo
1059 1059
     {
1060 1060
         switch ($name) {
1061 1061
             case 'accept':
1062
-                $this->logDeprecation('Checking property XMLParser::' . $name . ' is deprecated');
1062
+                $this->logDeprecation('Checking property XMLParser::'.$name.' is deprecated');
1063 1063
                 return isset($this->current_parsing_options['accept']);
1064 1064
             case '_xh':
1065 1065
             case 'xmlrpc_valid_parents':
1066
-                $this->logDeprecation('Checking property XMLParser::' . $name . ' is deprecated');
1066
+                $this->logDeprecation('Checking property XMLParser::'.$name.' is deprecated');
1067 1067
                 return isset($this->$name);
1068 1068
             default:
1069 1069
                 return false;
@@ -1075,18 +1075,18 @@  discard block
 block discarded – undo
1075 1075
         switch ($name) {
1076 1076
             // q: does this make sense at all?
1077 1077
             case 'accept':
1078
-                $this->logDeprecation('Unsetting property XMLParser::' . $name . ' is deprecated');
1078
+                $this->logDeprecation('Unsetting property XMLParser::'.$name.' is deprecated');
1079 1079
                 unset($this->current_parsing_options['accept']);
1080 1080
                 break;
1081 1081
             case '_xh':
1082 1082
             case 'xmlrpc_valid_parents':
1083
-                $this->logDeprecation('Unsetting property XMLParser::' . $name . ' is deprecated');
1083
+                $this->logDeprecation('Unsetting property XMLParser::'.$name.' is deprecated');
1084 1084
                 unset($this->$name);
1085 1085
                 break;
1086 1086
             default:
1087 1087
                 /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
1088 1088
                 $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
1089
-                trigger_error('Undefined property via __unset(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING);
1089
+                trigger_error('Undefined property via __unset(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING);
1090 1090
         }
1091 1091
     }
1092 1092
 }
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.