Passed
Push — master ( 39e37e...248e0b )
by Gaetano
12:40
created
src/Value.php 1 patch
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
                     $this->me['struct'] = $val;
120 120
                     break;
121 121
                 default:
122
-                    $this->getLogger()->errorLog("XML-RPC: " . __METHOD__ . ": not a known type ($type)");
122
+                    $this->getLogger()->errorLog("XML-RPC: ".__METHOD__.": not a known type ($type)");
123 123
             }
124 124
         }
125 125
     }
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
         }
145 145
 
146 146
         if ($typeOf !== 1) {
147
-            $this->getLogger()->errorLog("XML-RPC: " . __METHOD__ . ": not a scalar type ($type)");
147
+            $this->getLogger()->errorLog("XML-RPC: ".__METHOD__.": not a scalar type ($type)");
148 148
             return 0;
149 149
         }
150 150
 
@@ -161,10 +161,10 @@  discard block
 block discarded – undo
161 161
 
162 162
         switch ($this->mytype) {
163 163
             case 1:
164
-                $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': scalar xmlrpc value can have only one value');
164
+                $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': scalar xmlrpc value can have only one value');
165 165
                 return 0;
166 166
             case 3:
167
-                $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': cannot add anonymous scalar to struct xmlrpc value');
167
+                $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': cannot add anonymous scalar to struct xmlrpc value');
168 168
                 return 0;
169 169
             case 2:
170 170
                 // we're adding a scalar value to an array here
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 
207 207
             return 1;
208 208
         } else {
209
-            $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']');
209
+            $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']');
210 210
             return 0;
211 211
         }
212 212
     }
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 
238 238
             return 1;
239 239
         } else {
240
-            $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']');
240
+            $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']');
241 241
             return 0;
242 242
         }
243 243
     }
@@ -279,19 +279,19 @@  discard block
 block discarded – undo
279 279
             case 1:
280 280
                 switch ($typ) {
281 281
                     case static::$xmlrpcBase64:
282
-                        $rs .= "<${typ}>" . base64_encode($val) . "</${typ}>";
282
+                        $rs .= "<${typ}>".base64_encode($val)."</${typ}>";
283 283
                         break;
284 284
                     case static::$xmlrpcBoolean:
285
-                        $rs .= "<${typ}>" . ($val ? '1' : '0') . "</${typ}>";
285
+                        $rs .= "<${typ}>".($val ? '1' : '0')."</${typ}>";
286 286
                         break;
287 287
                     case static::$xmlrpcString:
288 288
                         // Do NOT use htmlentities, since it will produce named html entities, which are invalid xml
289
-                        $rs .= "<${typ}>" . $this->getCharsetEncoder()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</${typ}>";
289
+                        $rs .= "<${typ}>".$this->getCharsetEncoder()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</${typ}>";
290 290
                         break;
291 291
                     case static::$xmlrpcInt:
292 292
                     case static::$xmlrpcI4:
293 293
                     case static::$xmlrpcI8:
294
-                        $rs .= "<${typ}>" . (int)$val . "</${typ}>";
294
+                        $rs .= "<${typ}>".(int) $val."</${typ}>";
295 295
                         break;
296 296
                     case static::$xmlrpcDouble:
297 297
                         // avoid using standard conversion of float to string because it is locale-dependent,
@@ -299,15 +299,15 @@  discard block
 block discarded – undo
299 299
                         // sprintf('%F') could be most likely ok but it fails eg. on 2e-14.
300 300
                         // The code below tries its best at keeping max precision while avoiding exp notation,
301 301
                         // but there is of course no limit in the number of decimal places to be used...
302
-                        $rs .= "<${typ}>" . preg_replace('/\\.?0+$/', '', number_format((double)$val, PhpXmlRpc::$xmlpc_double_precision, '.', '')) . "</${typ}>";
302
+                        $rs .= "<${typ}>".preg_replace('/\\.?0+$/', '', number_format((double) $val, PhpXmlRpc::$xmlpc_double_precision, '.', ''))."</${typ}>";
303 303
                         break;
304 304
                     case static::$xmlrpcDateTime:
305 305
                         if (is_string($val)) {
306 306
                             $rs .= "<${typ}>${val}</${typ}>";
307 307
                         } elseif (is_a($val, 'DateTime') || is_a($val, 'DateTimeInterface')) {
308
-                            $rs .= "<${typ}>" . $val->format('Ymd\TH:i:s') . "</${typ}>";
308
+                            $rs .= "<${typ}>".$val->format('Ymd\TH:i:s')."</${typ}>";
309 309
                         } elseif (is_int($val)) {
310
-                            $rs .= "<${typ}>" . date('Ymd\TH:i:s', $val) . "</${typ}>";
310
+                            $rs .= "<${typ}>".date('Ymd\TH:i:s', $val)."</${typ}>";
311 311
                         } else {
312 312
                             // not really a good idea here: but what shall we output anyway? left for backward compat...
313 313
                             $rs .= "<${typ}>${val}</${typ}>";
@@ -329,14 +329,14 @@  discard block
 block discarded – undo
329 329
             case 3:
330 330
                 // struct
331 331
                 if ($this->_php_class) {
332
-                    $rs .= '<struct php_class="' . $this->_php_class . "\">\n";
332
+                    $rs .= '<struct php_class="'.$this->_php_class."\">\n";
333 333
                 } else {
334 334
                     $rs .= "<struct>\n";
335 335
                 }
336 336
                 $charsetEncoder = $this->getCharsetEncoder();
337 337
                 /** @var Value $val2 */
338 338
                 foreach ($val as $key2 => $val2) {
339
-                    $rs .= '<member><name>' . $charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</name>\n";
339
+                    $rs .= '<member><name>'.$charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</name>\n";
340 340
                     //$rs.=$this->serializeval($val2);
341 341
                     $rs .= $val2->serialize($charsetEncoding);
342 342
                     $rs .= "</member>\n";
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
         $val = reset($this->me);
373 373
         $typ = key($this->me);
374 374
 
375
-        return '<value>' . $this->serializedata($typ, $val, $charsetEncoding) . "</value>\n";
375
+        return '<value>'.$this->serializedata($typ, $val, $charsetEncoding)."</value>\n";
376 376
     }
377 377
 
378 378
     /**
Please login to merge, or discard this patch.
debugger/action.php 1 patch
Spacing   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -92,13 +92,13 @@  discard block
 block discarded – undo
92 92
 <body>
93 93
 <?php
94 94
 
95
-include __DIR__ . '/common.php';
95
+include __DIR__.'/common.php';
96 96
 
97 97
 if ($action) {
98 98
 
99 99
     // make sure the script waits long enough for the call to complete...
100 100
     if ($timeout) {
101
-        set_time_limit($timeout + 10);
101
+        set_time_limit($timeout+10);
102 102
     }
103 103
 
104 104
     if ($wstype == 1) {
@@ -123,13 +123,13 @@  discard block
 block discarded – undo
123 123
         $server = "$host$path";
124 124
     }
125 125
     if ($protocol == 2) {
126
-        $server = 'https://' . $server;
126
+        $server = 'https://'.$server;
127 127
     } else {
128
-        $server = 'http://' . $server;
128
+        $server = 'http://'.$server;
129 129
     }
130 130
     if ($proxy != '') {
131 131
         $pproxy = explode(':', $proxy);
132
-        if (count($pproxy) > 1) {
132
+        if (count($pproxy)>1) {
133 133
             $pport = $pproxy[1];
134 134
         } else {
135 135
             $pport = 8080;
@@ -198,9 +198,9 @@  discard block
 block discarded – undo
198 198
         case 'wrap':
199 199
             $msg[0] = new $requestClass('system.methodHelp', array(), $id);
200 200
             $msg[0]->addparam(new PhpXmlRpc\Value($method));
201
-            $msg[1] = new $requestClass('system.methodSignature', array(), (int)$id + 1);
201
+            $msg[1] = new $requestClass('system.methodSignature', array(), (int) $id+1);
202 202
             $msg[1]->addparam(new PhpXmlRpc\Value($method));
203
-            $actionname = 'Description of method "' . $method . '"';
203
+            $actionname = 'Description of method "'.$method.'"';
204 204
             break;
205 205
         case 'list':
206 206
             $msg[0] = new $requestClass('system.listMethods', array(), $id);
@@ -213,9 +213,9 @@  discard block
 block discarded – undo
213 213
             $msg[0] = new $requestClass($method, array(), $id);
214 214
             // hack! build xml payload by hand
215 215
             if ($wstype == 1) {
216
-                $msg[0]->payload = "{\n" .
217
-                    '"method": "' . $method . "\",\n\"params\": [" .
218
-                    $payload .
216
+                $msg[0]->payload = "{\n".
217
+                    '"method": "'.$method."\",\n\"params\": [".
218
+                    $payload.
219 219
                     "\n],\n\"id\": ";
220 220
                 // fix: if user gave an empty string, use NULL, or we'll break json syntax
221 221
                 if ($id == "") {
@@ -228,20 +228,20 @@  discard block
 block discarded – undo
228 228
                     }
229 229
                 }
230 230
             } else {
231
-                $msg[0]->payload = $msg[0]->xml_header($inputcharset) .
232
-                    '<methodName>' . $method . "</methodName>\n<params>" .
233
-                    $payload .
234
-                    "</params>\n" . $msg[0]->xml_footer();
231
+                $msg[0]->payload = $msg[0]->xml_header($inputcharset).
232
+                    '<methodName>'.$method."</methodName>\n<params>".
233
+                    $payload.
234
+                    "</params>\n".$msg[0]->xml_footer();
235 235
             }
236
-            $actionname = 'Execution of method ' . $method;
236
+            $actionname = 'Execution of method '.$method;
237 237
             break;
238 238
         default: // give a warning
239
-            $actionname = '[ERROR: unknown action] "' . $action . '"';
239
+            $actionname = '[ERROR: unknown action] "'.$action.'"';
240 240
     }
241 241
 
242 242
     // Before calling execute, echo out brief description of action taken + date and time ???
243 243
     // this gives good user feedback for long-running methods...
244
-    echo '<h2>' . htmlspecialchars($actionname, ENT_COMPAT, $inputcharset) . ' on server ' . htmlspecialchars($server, ENT_COMPAT, $inputcharset) . " ...</h2>\n";
244
+    echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset)." ...</h2>\n";
245 245
     flush();
246 246
 
247 247
     $response = null;
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
             break;
260 260
         }
261 261
     }
262
-    $time = microtime(true) - $time;
262
+    $time = microtime(true)-$time;
263 263
     if ($debug) {
264 264
         echo "</div>\n";
265 265
     }
@@ -269,8 +269,8 @@  discard block
 block discarded – undo
269 269
             // call failed! echo out error msg!
270 270
             //echo '<h2>'.htmlspecialchars($actionname, ENT_COMPAT, $inputcharset).' on server '.htmlspecialchars($server, ENT_COMPAT, $inputcharset).'</h2>';
271 271
             echo "<h3>$protoName call FAILED!</h3>\n";
272
-            echo "<p>Fault code: [" . htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
273
-                "] Reason: '" . htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "'</p>\n";
272
+            echo "<p>Fault code: [".htmlspecialchars($response->faultCode(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding).
273
+                "] Reason: '".htmlspecialchars($response->faultString(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."'</p>\n";
274 274
             echo(date("d/M/Y:H:i:s\n"));
275 275
         } else {
276 276
             // call succeeded: parse results
@@ -286,36 +286,36 @@  discard block
 block discarded – undo
286 286
                         $max = $v->count();
287 287
                         echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
288 288
                         echo "<thead>\n<tr><th>Method ($max)</th><th>Description</th></tr>\n</thead>\n<tbody>\n";
289
-                        foreach($v as $i => $rec) {
289
+                        foreach ($v as $i => $rec) {
290 290
                             if ($i % 2) {
291 291
                                 $class = ' class="oddrow"';
292 292
                             } else {
293 293
                                 $class = ' class="evenrow"';
294 294
                             }
295
-                            echo("<tr><td$class>" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">" .
296
-                                "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" .
297
-                                "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" .
298
-                                "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" .
299
-                                "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" .
300
-                                "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" .
301
-                                "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" .
302
-                                "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" .
303
-                                "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" .
304
-                                "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" .
305
-                                "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" .
306
-                                "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" .
307
-                                "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" .
308
-                                "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" .
309
-                                "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" .
310
-                                "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" .
311
-                                "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" .
312
-                                "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" .
313
-                                "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" .
314
-                                "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" .
315
-                                "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "\" />" .
316
-                                "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" .
317
-                                "<input type=\"hidden\" name=\"action\" value=\"describe\" />" .
318
-                                "<input type=\"hidden\" name=\"run\" value=\"now\" />" .
295
+                            echo("<tr><td$class>".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."</td><td$class><form action=\"controller.php\" method=\"get\" target=\"frmcontroller\">".
296
+                                "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />".
297
+                                "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />".
298
+                                "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />".
299
+                                "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />".
300
+                                "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />".
301
+                                "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />".
302
+                                "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />".
303
+                                "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />".
304
+                                "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />".
305
+                                "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />".
306
+                                "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />".
307
+                                "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />".
308
+                                "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />".
309
+                                "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />".
310
+                                "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />".
311
+                                "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />".
312
+                                "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />".
313
+                                "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />".
314
+                                "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />".
315
+                                "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($rec->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."\" />".
316
+                                "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />".
317
+                                "<input type=\"hidden\" name=\"action\" value=\"describe\" />".
318
+                                "<input type=\"hidden\" name=\"run\" value=\"now\" />".
319 319
                                 "<input type=\"submit\" value=\"Describe\" /></form></td>");
320 320
                             //echo("</tr>\n");
321 321
 
@@ -342,7 +342,7 @@  discard block
 block discarded – undo
342 342
                     $r2 = $resp[1]->value();
343 343
 
344 344
                     echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
345
-                    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";
345
+                    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";
346 346
                     $desc = htmlspecialchars($r1->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding);
347 347
                     if ($desc == "") {
348 348
                         $desc = "-";
@@ -352,41 +352,41 @@  discard block
 block discarded – undo
352 352
                     if ($r2->kindOf() != "array") {
353 353
                         echo "<tr><td class=\"oddrow\">Signature</td><td class=\"oddrow\">Unknown</td><td class=\"oddrow\">&nbsp;</td></tr>\n";
354 354
                     } else {
355
-                        foreach($r2 as $i => $x) {
355
+                        foreach ($r2 as $i => $x) {
356 356
                             $payload = "";
357 357
                             $alt_payload = "";
358
-                            if ($i + 1 % 2) {
358
+                            if ($i+1 % 2) {
359 359
                                 $class = ' class="oddrow"';
360 360
                             } else {
361 361
                                 $class = ' class="evenrow"';
362 362
                             }
363
-                            echo "<tr><td$class>Signature&nbsp;" . ($i + 1) . "</td><td$class>";
363
+                            echo "<tr><td$class>Signature&nbsp;".($i+1)."</td><td$class>";
364 364
                             if ($x->kindOf() == "array") {
365 365
                                 $ret = $x[0];
366
-                                echo "<code>OUT:&nbsp;" . htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) . "<br />IN: (";
367
-                                if ($x->count() > 1) {
368
-                                    foreach($x as $k => $y) {
366
+                                echo "<code>OUT:&nbsp;".htmlspecialchars($ret->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding)."<br />IN: (";
367
+                                if ($x->count()>1) {
368
+                                    foreach ($x as $k => $y) {
369 369
                                         if ($k == 0) continue;
370 370
                                         echo htmlspecialchars($y->scalarval(), ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding);
371 371
                                         if ($wstype != 1) {
372 372
                                             $type = $y->scalarval();
373 373
                                             $payload .= '<param><value>';
374
-                                            switch($type) {
374
+                                            switch ($type) {
375 375
                                                 case 'undefined':
376 376
                                                     break;
377 377
                                                 case 'null';
378 378
                                                     $type = 'nil';
379 379
                                                     // fall thru intentionally
380 380
                                                 default:
381
-                                                    $payload .= '<' .
382
-                                                        htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
383
-                                                        '></' . htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding) .
381
+                                                    $payload .= '<'.
382
+                                                        htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding).
383
+                                                        '></'.htmlspecialchars($type, ENT_COMPAT, \PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding).
384 384
                                                         '>';
385 385
                                             }
386 386
                                             $payload .= "</value></param>\n";
387 387
                                         }
388 388
                                         $alt_payload .= $y->scalarval();
389
-                                        if ($k < $x->count() - 1) {
389
+                                        if ($k<$x->count()-1) {
390 390
                                             $alt_payload .= ';';
391 391
                                             echo ", ";
392 392
                                         }
@@ -399,63 +399,63 @@  discard block
 block discarded – undo
399 399
                             echo '</td>';
400 400
                             // button to test this method
401 401
                             //$payload="<methodCall>\n<methodName>$method</methodName>\n<params>\n$payload</params>\n</methodCall>";
402
-                            echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" .
403
-                                "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" .
404
-                                "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" .
405
-                                "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" .
406
-                                "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" .
407
-                                "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" .
408
-                                "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" .
409
-                                "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" .
410
-                                "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" .
411
-                                "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" .
412
-                                "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" .
413
-                                "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" .
414
-                                "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" .
415
-                                "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" .
416
-                                "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" .
417
-                                "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" .
418
-                                "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" .
419
-                                "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" .
420
-                                "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" .
421
-                                "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" .
422
-                                "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" .
423
-                                "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" .
424
-                                "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" .
425
-                                "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" .
402
+                            echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">".
403
+                                "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />".
404
+                                "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />".
405
+                                "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />".
406
+                                "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />".
407
+                                "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />".
408
+                                "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />".
409
+                                "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />".
410
+                                "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />".
411
+                                "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />".
412
+                                "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />".
413
+                                "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />".
414
+                                "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />".
415
+                                "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />".
416
+                                "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />".
417
+                                "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />".
418
+                                "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />".
419
+                                "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />".
420
+                                "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />".
421
+                                "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />".
422
+                                "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />".
423
+                                "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />".
424
+                                "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />".
425
+                                "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />".
426 426
                                 "<input type=\"hidden\" name=\"action\" value=\"execute\" />";
427 427
                             if ($wstype != 1) {
428 428
                                 echo "<input type=\"submit\" value=\"Load method synopsis\" />";
429 429
                             }
430 430
                             echo "</form></td>\n";
431 431
 
432
-                            echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">" .
433
-                                "<input type=\"hidden\" name=\"host\" value=\"" . htmlspecialchars($host, ENT_COMPAT, $inputcharset) . "\" />" .
434
-                                "<input type=\"hidden\" name=\"port\" value=\"" . htmlspecialchars($port, ENT_COMPAT, $inputcharset) . "\" />" .
435
-                                "<input type=\"hidden\" name=\"path\" value=\"" . htmlspecialchars($path, ENT_COMPAT, $inputcharset) . "\" />" .
436
-                                "<input type=\"hidden\" name=\"id\" value=\"" . htmlspecialchars($id, ENT_COMPAT, $inputcharset) . "\" />" .
437
-                                "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />" .
438
-                                "<input type=\"hidden\" name=\"username\" value=\"" . htmlspecialchars($username, ENT_COMPAT, $inputcharset) . "\" />" .
439
-                                "<input type=\"hidden\" name=\"password\" value=\"" . htmlspecialchars($password, ENT_COMPAT, $inputcharset) . "\" />" .
440
-                                "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />" .
441
-                                "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />" .
442
-                                "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />" .
443
-                                "<input type=\"hidden\" name=\"cainfo\" value=\"" . htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset) . "\" />" .
444
-                                "<input type=\"hidden\" name=\"proxy\" value=\"" . htmlspecialchars($proxy, ENT_COMPAT, $inputcharset) . "\" />" .
445
-                                "<input type=\"hidden\" name=\"proxyuser\" value=\"" . htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset) . "\" />" .
446
-                                "<input type=\"hidden\" name=\"proxypwd\" value=\"" . htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset) . "\" />" .
447
-                                "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />" .
448
-                                "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />" .
449
-                                "<input type=\"hidden\" name=\"clientcookies\" value=\"" . htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset) . "\" />" .
450
-                                "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />" .
451
-                                "<input type=\"hidden\" name=\"timeout\" value=\"" . htmlspecialchars($timeout, ENT_COMPAT, $inputcharset) . "\" />" .
452
-                                "<input type=\"hidden\" name=\"method\" value=\"" . htmlspecialchars($method, ENT_COMPAT, $inputcharset) . "\" />" .
453
-                                "<input type=\"hidden\" name=\"methodsig\" value=\"" . $i . "\" />" .
454
-                                "<input type=\"hidden\" name=\"methodpayload\" value=\"" . htmlspecialchars($payload, ENT_COMPAT, $inputcharset) . "\" />" .
455
-                                "<input type=\"hidden\" name=\"altmethodpayload\" value=\"" . htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset) . "\" />" .
456
-                                "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />" .
457
-                                "<input type=\"hidden\" name=\"run\" value=\"now\" />" .
458
-                                "<input type=\"hidden\" name=\"action\" value=\"wrap\" />" .
432
+                            echo "<td$class><form action=\"controller.php\" target=\"frmcontroller\" method=\"get\">".
433
+                                "<input type=\"hidden\" name=\"host\" value=\"".htmlspecialchars($host, ENT_COMPAT, $inputcharset)."\" />".
434
+                                "<input type=\"hidden\" name=\"port\" value=\"".htmlspecialchars($port, ENT_COMPAT, $inputcharset)."\" />".
435
+                                "<input type=\"hidden\" name=\"path\" value=\"".htmlspecialchars($path, ENT_COMPAT, $inputcharset)."\" />".
436
+                                "<input type=\"hidden\" name=\"id\" value=\"".htmlspecialchars($id, ENT_COMPAT, $inputcharset)."\" />".
437
+                                "<input type=\"hidden\" name=\"debug\" value=\"$debug\" />".
438
+                                "<input type=\"hidden\" name=\"username\" value=\"".htmlspecialchars($username, ENT_COMPAT, $inputcharset)."\" />".
439
+                                "<input type=\"hidden\" name=\"password\" value=\"".htmlspecialchars($password, ENT_COMPAT, $inputcharset)."\" />".
440
+                                "<input type=\"hidden\" name=\"authtype\" value=\"$authtype\" />".
441
+                                "<input type=\"hidden\" name=\"verifyhost\" value=\"$verifyhost\" />".
442
+                                "<input type=\"hidden\" name=\"verifypeer\" value=\"$verifypeer\" />".
443
+                                "<input type=\"hidden\" name=\"cainfo\" value=\"".htmlspecialchars($cainfo, ENT_COMPAT, $inputcharset)."\" />".
444
+                                "<input type=\"hidden\" name=\"proxy\" value=\"".htmlspecialchars($proxy, ENT_COMPAT, $inputcharset)."\" />".
445
+                                "<input type=\"hidden\" name=\"proxyuser\" value=\"".htmlspecialchars($proxyuser, ENT_COMPAT, $inputcharset)."\" />".
446
+                                "<input type=\"hidden\" name=\"proxypwd\" value=\"".htmlspecialchars($proxypwd, ENT_COMPAT, $inputcharset)."\" />".
447
+                                "<input type=\"hidden\" name=\"responsecompression\" value=\"$responsecompression\" />".
448
+                                "<input type=\"hidden\" name=\"requestcompression\" value=\"$requestcompression\" />".
449
+                                "<input type=\"hidden\" name=\"clientcookies\" value=\"".htmlspecialchars($clientcookies, ENT_COMPAT, $inputcharset)."\" />".
450
+                                "<input type=\"hidden\" name=\"protocol\" value=\"$protocol\" />".
451
+                                "<input type=\"hidden\" name=\"timeout\" value=\"".htmlspecialchars($timeout, ENT_COMPAT, $inputcharset)."\" />".
452
+                                "<input type=\"hidden\" name=\"method\" value=\"".htmlspecialchars($method, ENT_COMPAT, $inputcharset)."\" />".
453
+                                "<input type=\"hidden\" name=\"methodsig\" value=\"".$i."\" />".
454
+                                "<input type=\"hidden\" name=\"methodpayload\" value=\"".htmlspecialchars($payload, ENT_COMPAT, $inputcharset)."\" />".
455
+                                "<input type=\"hidden\" name=\"altmethodpayload\" value=\"".htmlspecialchars($alt_payload, ENT_COMPAT, $inputcharset)."\" />".
456
+                                "<input type=\"hidden\" name=\"wstype\" value=\"$wstype\" />".
457
+                                "<input type=\"hidden\" name=\"run\" value=\"now\" />".
458
+                                "<input type=\"hidden\" name=\"action\" value=\"wrap\" />".
459 459
                                 "<input type=\"submit\" value=\"Generate method call stub code\" />";
460 460
                             echo "</form></td></tr>\n";
461 461
                         }
@@ -467,14 +467,14 @@  discard block
 block discarded – undo
467 467
                 case 'wrap':
468 468
                     $r1 = $resp[0]->value();
469 469
                     $r2 = $resp[1]->value();
470
-                    if ($r2->kindOf() != "array" || $r2->count() <= $methodsig) {
470
+                    if ($r2->kindOf() != "array" || $r2->count()<=$methodsig) {
471 471
                         echo "Error: signature unknown\n";
472 472
                     } else {
473 473
                         $mdesc = $r1->scalarval();
474 474
                         $encoder = new PhpXmlRpc\Encoder();
475 475
                         $msig = $encoder->decode($r2);
476 476
                         $msig = $msig[$methodsig];
477
-                        $proto = $protocol == 2 ? 'https' : ( $protocol == 1 ? 'http11' : '' );
477
+                        $proto = $protocol == 2 ? 'https' : ($protocol == 1 ? 'http11' : '');
478 478
                         if ($proxy == '' && $username == '' && !$requestcompression && !$responsecompression &&
479 479
                             $clientcookies == ''
480 480
                         ) {
@@ -488,11 +488,11 @@  discard block
 block discarded – undo
488 488
                             $prefix = 'xmlrpc';
489 489
                         }
490 490
                         $wrapper = new PhpXmlRpc\Wrapper();
491
-                        $code = $wrapper->buildWrapMethodSource($client, $method, array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix), str_replace('.', '_', $prefix . '_' . $method), $msig, $mdesc);
491
+                        $code = $wrapper->buildWrapMethodSource($client, $method, array('timeout' => $timeout, 'protocol' => $proto, 'simple_client_copy' => $opts, 'prefix' => $prefix), str_replace('.', '_', $prefix.'_'.$method), $msig, $mdesc);
492 492
                         //if ($code)
493 493
                         //{
494 494
                         echo "<div id=\"phpcode\">\n";
495
-                        highlight_string("<?php\n" . $code['docstring'] . $code['source'] . '?>');
495
+                        highlight_string("<?php\n".$code['docstring'].$code['source'].'?>');
496 496
                         echo "\n</div>";
497 497
                         //}
498 498
                         //else
@@ -503,7 +503,7 @@  discard block
 block discarded – undo
503 503
                     break;
504 504
 
505 505
                 case 'execute':
506
-                    echo '<div id="response"><h2>Response:</h2>' . htmlspecialchars($response->serialize()) . '</div>';
506
+                    echo '<div id="response"><h2>Response:</h2>'.htmlspecialchars($response->serialize()).'</div>';
507 507
                     break;
508 508
 
509 509
                 default: // give a warning
Please login to merge, or discard this patch.