Completed
Push — master ( 252344...1eeaee )
by Gaetano
04:02 queued 11s
created
src/Helper/XMLParser.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
     protected $maxChunkLength = 4194304; // 4 MB
76 76
 
77 77
     /**
78
-     * @param array $options passed to the xml parser
78
+     * @param string[] $options passed to the xml parser
79 79
      */
80 80
     public function __construct(array $options = array())
81 81
     {
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -130,10 +130,10 @@  discard block
 block discarded – undo
130 130
         );
131 131
 
132 132
         $len = strlen($data);
133
-        for ($offset = 0; $offset < $len; $offset += $this->maxChunkLength) {
133
+        for ($offset = 0; $offset<$len; $offset += $this->maxChunkLength) {
134 134
             $chunk = substr($data, $offset, $this->maxChunkLength);
135 135
             // error handling: xml not well formed
136
-            if (!xml_parse($parser, $chunk, $offset + $this->maxChunkLength >= $len)) {
136
+            if (!xml_parse($parser, $chunk, $offset+$this->maxChunkLength>=$len)) {
137 137
                 $errCode = xml_get_error_code($parser);
138 138
                 $errStr = sprintf('XML error %s: %s at line %d, column %d', $errCode, xml_error_string($errCode),
139 139
                     xml_get_current_line_number($parser), xml_get_current_column_number($parser));
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     public function xmlrpc_se($parser, $name, $attrs, $acceptSingleVals = false)
158 158
     {
159 159
         // if invalid xmlrpc already detected, skip all processing
160
-        if ($this->_xh['isf'] < 2) {
160
+        if ($this->_xh['isf']<2) {
161 161
 
162 162
             // check for correct element nesting
163 163
             if (count($this->_xh['stack']) == 0) {
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
                     $this->_xh['rt'] = strtolower($name);
177 177
                 } else {
178 178
                     $this->_xh['isf'] = 2;
179
-                    $this->_xh['isf_reason'] = 'missing top level xmlrpc element. Found: ' . $name;
179
+                    $this->_xh['isf_reason'] = 'missing top level xmlrpc element. Found: '.$name;
180 180
 
181 181
                     return;
182 182
                 }
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
                     break;
271 271
                 case 'MEMBER':
272 272
                     // set member name to null, in case we do not find in the xml later on
273
-                    $this->_xh['valuestack'][count($this->_xh['valuestack']) - 1]['name'] = '';
273
+                    $this->_xh['valuestack'][count($this->_xh['valuestack'])-1]['name'] = '';
274 274
                     //$this->_xh['ac']='';
275 275
                 // Drop trough intentionally
276 276
                 case 'PARAM':
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
      */
331 331
     public function xmlrpc_ee($parser, $name, $rebuildXmlrpcvals = true)
332 332
     {
333
-        if ($this->_xh['isf'] < 2) {
333
+        if ($this->_xh['isf']<2) {
334 334
             // push this element name from stack
335 335
             // NB: if XML validates, correct opening/closing is guaranteed and
336 336
             // we do not have to check for $name == $currElem.
@@ -356,8 +356,8 @@  discard block
 block discarded – undo
356 356
                         // check if we are inside an array or struct:
357 357
                         // if value just built is inside an array, let's move it into array on the stack
358 358
                         $vscount = count($this->_xh['valuestack']);
359
-                        if ($vscount && $this->_xh['valuestack'][$vscount - 1]['type'] == 'ARRAY') {
360
-                            $this->_xh['valuestack'][$vscount - 1]['values'][] = $temp;
359
+                        if ($vscount && $this->_xh['valuestack'][$vscount-1]['type'] == 'ARRAY') {
360
+                            $this->_xh['valuestack'][$vscount-1]['values'][] = $temp;
361 361
                         } else {
362 362
                             $this->_xh['value'] = $temp;
363 363
                         }
@@ -371,8 +371,8 @@  discard block
 block discarded – undo
371 371
                         // check if we are inside an array or struct:
372 372
                         // if value just built is inside an array, let's move it into array on the stack
373 373
                         $vscount = count($this->_xh['valuestack']);
374
-                        if ($vscount && $this->_xh['valuestack'][$vscount - 1]['type'] == 'ARRAY') {
375
-                            $this->_xh['valuestack'][$vscount - 1]['values'][] = $this->_xh['value'];
374
+                        if ($vscount && $this->_xh['valuestack'][$vscount-1]['type'] == 'ARRAY') {
375
+                            $this->_xh['valuestack'][$vscount-1]['values'][] = $this->_xh['value'];
376 376
                         }
377 377
                     }
378 378
                     break;
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
                         $this->_xh['value'] = $this->_xh['ac'];
393 393
                     } elseif ($name == 'DATETIME.ISO8601') {
394 394
                         if (!preg_match('/^[0-9]{8}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/', $this->_xh['ac'])) {
395
-                            error_log('XML-RPC: ' . __METHOD__ . ': invalid value received in DATETIME: ' . $this->_xh['ac']);
395
+                            error_log('XML-RPC: '.__METHOD__.': invalid value received in DATETIME: '.$this->_xh['ac']);
396 396
                         }
397 397
                         $this->_xh['vt'] = Value::$xmlrpcDateTime;
398 398
                         $this->_xh['value'] = $this->_xh['ac'];
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
                         } else {
412 412
                             // log if receiving something strange, even though we set the value to false anyway
413 413
                             if ($this->_xh['ac'] != '0' && strcasecmp($this->_xh['ac'], 'false') != 0) {
414
-                                error_log('XML-RPC: ' . __METHOD__ . ': invalid value received in BOOLEAN: ' . $this->_xh['ac']);
414
+                                error_log('XML-RPC: '.__METHOD__.': invalid value received in BOOLEAN: '.$this->_xh['ac']);
415 415
                             }
416 416
                             $this->_xh['value'] = false;
417 417
                         }
@@ -421,37 +421,37 @@  discard block
 block discarded – undo
421 421
                         // NOTE: regexp could be much stricter than this...
422 422
                         if (!preg_match('/^[+-eE0123456789 \t.]+$/', $this->_xh['ac'])) {
423 423
                             /// @todo: find a better way of throwing an error than this!
424
-                            error_log('XML-RPC: ' . __METHOD__ . ': non numeric value received in DOUBLE: ' . $this->_xh['ac']);
424
+                            error_log('XML-RPC: '.__METHOD__.': non numeric value received in DOUBLE: '.$this->_xh['ac']);
425 425
                             $this->_xh['value'] = 'ERROR_NON_NUMERIC_FOUND';
426 426
                         } else {
427 427
                             // it's ok, add it on
428
-                            $this->_xh['value'] = (double)$this->_xh['ac'];
428
+                            $this->_xh['value'] = (double) $this->_xh['ac'];
429 429
                         }
430 430
                     } else {
431 431
                         // we have an I4/I8/INT
432 432
                         // we must check that only 0123456789-<space> are characters here
433 433
                         if (!preg_match('/^[+-]?[0123456789 \t]+$/', $this->_xh['ac'])) {
434 434
                             /// @todo find a better way of throwing an error than this!
435
-                            error_log('XML-RPC: ' . __METHOD__ . ': non numeric value received in INT: ' . $this->_xh['ac']);
435
+                            error_log('XML-RPC: '.__METHOD__.': non numeric value received in INT: '.$this->_xh['ac']);
436 436
                             $this->_xh['value'] = 'ERROR_NON_NUMERIC_FOUND';
437 437
                         } else {
438 438
                             // it's ok, add it on
439
-                            $this->_xh['value'] = (int)$this->_xh['ac'];
439
+                            $this->_xh['value'] = (int) $this->_xh['ac'];
440 440
                         }
441 441
                     }
442 442
                     $this->_xh['lv'] = 3; // indicate we've found a value
443 443
                     break;
444 444
                 case 'NAME':
445
-                    $this->_xh['valuestack'][count($this->_xh['valuestack']) - 1]['name'] = $this->_xh['ac'];
445
+                    $this->_xh['valuestack'][count($this->_xh['valuestack'])-1]['name'] = $this->_xh['ac'];
446 446
                     break;
447 447
                 case 'MEMBER':
448 448
                     // add to array in the stack the last element built,
449 449
                     // unless no VALUE was found
450 450
                     if ($this->_xh['vt']) {
451 451
                         $vscount = count($this->_xh['valuestack']);
452
-                        $this->_xh['valuestack'][$vscount - 1]['values'][$this->_xh['valuestack'][$vscount - 1]['name']] = $this->_xh['value'];
452
+                        $this->_xh['valuestack'][$vscount-1]['values'][$this->_xh['valuestack'][$vscount-1]['name']] = $this->_xh['value'];
453 453
                     } else {
454
-                        error_log('XML-RPC: ' . __METHOD__ . ': missing VALUE inside STRUCT in received xml');
454
+                        error_log('XML-RPC: '.__METHOD__.': missing VALUE inside STRUCT in received xml');
455 455
                     }
456 456
                     break;
457 457
                 case 'DATA':
@@ -474,7 +474,7 @@  discard block
 block discarded – undo
474 474
                         $this->_xh['params'][] = $this->_xh['value'];
475 475
                         $this->_xh['pt'][] = $this->_xh['vt'];
476 476
                     } else {
477
-                        error_log('XML-RPC: ' . __METHOD__ . ': missing VALUE inside PARAM in received xml');
477
+                        error_log('XML-RPC: '.__METHOD__.': missing VALUE inside PARAM in received xml');
478 478
                     }
479 479
                     break;
480 480
                 case 'METHODNAME':
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
     public function xmlrpc_cd($parser, $data)
521 521
     {
522 522
         // skip processing if xml fault already detected
523
-        if ($this->_xh['isf'] < 2) {
523
+        if ($this->_xh['isf']<2) {
524 524
             // "lookforvalue==3" means that we've found an entire value
525 525
             // and should discard any further character data
526 526
             if ($this->_xh['lv'] != 3) {
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
     public function xmlrpc_dh($parser, $data)
539 539
     {
540 540
         // skip processing if xml fault already detected
541
-        if ($this->_xh['isf'] < 2) {
541
+        if ($this->_xh['isf']<2) {
542 542
             if (substr($data, 0, 1) == '&' && substr($data, -1, 1) == ';') {
543 543
                 $this->_xh['ac'] .= $data;
544 544
             }
@@ -609,8 +609,8 @@  discard block
 block discarded – undo
609 609
         // Details:
610 610
         // SPACE:         (#x20 | #x9 | #xD | #xA)+ === [ \x9\xD\xA]+
611 611
         // EQ:            SPACE?=SPACE? === [ \x9\xD\xA]*=[ \x9\xD\xA]*
612
-        if (preg_match('/^<\?xml\s+version\s*=\s*' . "((?:\"[a-zA-Z0-9_.:-]+\")|(?:'[a-zA-Z0-9_.:-]+'))" .
613
-            '\s+encoding\s*=\s*' . "((?:\"[A-Za-z][A-Za-z0-9._-]*\")|(?:'[A-Za-z][A-Za-z0-9._-]*'))/",
612
+        if (preg_match('/^<\?xml\s+version\s*=\s*'."((?:\"[a-zA-Z0-9_.:-]+\")|(?:'[a-zA-Z0-9_.:-]+'))".
613
+            '\s+encoding\s*=\s*'."((?:\"[A-Za-z][A-Za-z0-9._-]*\")|(?:'[A-Za-z][A-Za-z0-9._-]*'))/",
614 614
             $xmlChunk, $matches)) {
615 615
             return strtoupper(substr($matches[2], 1, -1));
616 616
         }
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
             // NB: mb_detect likes to call it ascii, xml parser likes to call it US_ASCII...
629 629
             // IANA also likes better US-ASCII, so go with it
630 630
             if ($enc == 'ASCII') {
631
-                $enc = 'US-' . $enc;
631
+                $enc = 'US-'.$enc;
632 632
             }
633 633
 
634 634
             return $enc;
@@ -663,8 +663,8 @@  discard block
 block discarded – undo
663 663
         // Details:
664 664
         // SPACE:         (#x20 | #x9 | #xD | #xA)+ === [ \x9\xD\xA]+
665 665
         // EQ:            SPACE?=SPACE? === [ \x9\xD\xA]*=[ \x9\xD\xA]*
666
-        if (preg_match('/^<\?xml\s+version\s*=\s*' . "((?:\"[a-zA-Z0-9_.:-]+\")|(?:'[a-zA-Z0-9_.:-]+'))" .
667
-            '\s+encoding\s*=\s*' . "((?:\"[A-Za-z][A-Za-z0-9._-]*\")|(?:'[A-Za-z][A-Za-z0-9._-]*'))/",
666
+        if (preg_match('/^<\?xml\s+version\s*=\s*'."((?:\"[a-zA-Z0-9_.:-]+\")|(?:'[a-zA-Z0-9_.:-]+'))".
667
+            '\s+encoding\s*=\s*'."((?:\"[A-Za-z][A-Za-z0-9._-]*\")|(?:'[A-Za-z][A-Za-z0-9._-]*'))/",
668 668
             $xmlChunk, $matches)) {
669 669
             return true;
670 670
         }
Please login to merge, or discard this patch.
demo/client/agesort.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
 <p></p>
11 11
 <?php
12 12
 
13
-include_once __DIR__ . "/../../src/Autoloader.php";
13
+include_once __DIR__."/../../src/Autoloader.php";
14 14
 PhpXmlRpc\Autoloader::register();
15 15
 
16 16
 $inAr = array("Dave" => 24, "Edd" => 45, "Joe" => 37, "Fred" => 27);
17 17
 print "This is the input data:<br/><pre>";
18 18
 foreach ($inAr as $key => $val) {
19
-    print $key . ", " . $val . "\n";
19
+    print $key.", ".$val."\n";
20 20
 }
21 21
 print "</pre>";
22 22
 
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     );
33 33
 }
34 34
 $v = new PhpXmlRpc\Value($p, "array");
35
-print "Encoded into xmlrpc format it looks like this: <pre>\n" . htmlentities($v->serialize()) . "</pre>\n";
35
+print "Encoded into xmlrpc format it looks like this: <pre>\n".htmlentities($v->serialize())."</pre>\n";
36 36
 
37 37
 // create client and message objects
38 38
 $req = new PhpXmlRpc\Request('examples.sortByAge', array($v));
@@ -52,15 +52,15 @@  discard block
 block discarded – undo
52 52
     foreach ($value as $struct) {
53 53
         $name = $struct["name"];
54 54
         $age = $struct["age"];
55
-        print htmlspecialchars($name->scalarval()) . ", " . htmlspecialchars($age->scalarval()) . "\n";
55
+        print htmlspecialchars($name->scalarval()).", ".htmlspecialchars($age->scalarval())."\n";
56 56
     }
57 57
 
58
-    print "<hr/>For nerds: I got this value back<br/><pre>" .
59
-        htmlentities($resp->serialize()) . "</pre><hr/>\n";
58
+    print "<hr/>For nerds: I got this value back<br/><pre>".
59
+        htmlentities($resp->serialize())."</pre><hr/>\n";
60 60
 } else {
61 61
     print "An error occurred:<pre>";
62
-    print "Code: " . htmlspecialchars($resp->faultCode()) .
63
-        "\nReason: '" . htmlspecialchars($resp->faultString()) . '\'</pre><hr/>';
62
+    print "Code: ".htmlspecialchars($resp->faultCode()).
63
+        "\nReason: '".htmlspecialchars($resp->faultString()).'\'</pre><hr/>';
64 64
 }
65 65
 
66 66
 ?>
Please login to merge, or discard this patch.
src/Helper/Logger.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,10 +39,10 @@
 block discarded – undo
39 39
             $flags = ENT_COMPAT;
40 40
             // avoid warnings on php < 5.4...
41 41
             if (defined('ENT_HTML401')) {
42
-                $flags =  $flags | ENT_HTML401;
42
+                $flags = $flags | ENT_HTML401;
43 43
             }
44 44
             if (defined('ENT_SUBSTITUTE')) {
45
-                $flags =  $flags | ENT_SUBSTITUTE;
45
+                $flags = $flags | ENT_SUBSTITUTE;
46 46
             }
47 47
             if ($encoding != null) {
48 48
                 print "<PRE>\n".htmlentities($message, $flags, $encoding)."\n</PRE>";
Please login to merge, or discard this patch.
src/Request.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
     public function xml_header($charsetEncoding = '')
39 39
     {
40 40
         if ($charsetEncoding != '') {
41
-            return "<?xml version=\"1.0\" encoding=\"$charsetEncoding\" ?" . ">\n<methodCall>\n";
41
+            return "<?xml version=\"1.0\" encoding=\"$charsetEncoding\" ?".">\n<methodCall>\n";
42 42
         } else {
43
-            return "<?xml version=\"1.0\"?" . ">\n<methodCall>\n";
43
+            return "<?xml version=\"1.0\"?".">\n<methodCall>\n";
44 44
         }
45 45
     }
46 46
 
@@ -52,16 +52,16 @@  discard block
 block discarded – undo
52 52
     public function createPayload($charsetEncoding = '')
53 53
     {
54 54
         if ($charsetEncoding != '') {
55
-            $this->content_type = 'text/xml; charset=' . $charsetEncoding;
55
+            $this->content_type = 'text/xml; charset='.$charsetEncoding;
56 56
         } else {
57 57
             $this->content_type = 'text/xml';
58 58
         }
59 59
         $this->payload = $this->xml_header($charsetEncoding);
60
-        $this->payload .= '<methodName>' . Charset::instance()->encodeEntities(
61
-            $this->methodname, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</methodName>\n";
60
+        $this->payload .= '<methodName>'.Charset::instance()->encodeEntities(
61
+            $this->methodname, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</methodName>\n";
62 62
         $this->payload .= "<params>\n";
63 63
         foreach ($this->params as $p) {
64
-            $this->payload .= "<param>\n" . $p->serialize($charsetEncoding) .
64
+            $this->payload .= "<param>\n".$p->serialize($charsetEncoding).
65 65
                 "</param>\n";
66 66
         }
67 67
         $this->payload .= "</params>\n";
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         $this->httpResponse = array('raw_data' => $data, 'headers' => array(), 'cookies' => array());
187 187
 
188 188
         if ($data == '') {
189
-            error_log('XML-RPC: ' . __METHOD__ . ': no response received from server.');
189
+            error_log('XML-RPC: '.__METHOD__.': no response received from server.');
190 190
             return new Response(0, PhpXmlRpc::$xmlrpcerr['no_data'], PhpXmlRpc::$xmlrpcstr['no_data']);
191 191
         }
192 192
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
             $httpParser = new Http();
196 196
             try {
197 197
                 $this->httpResponse = $httpParser->parseResponseHeaders($data, $headersProcessed, $this->debug);
198
-            } catch(\Exception $e) {
198
+            } catch (\Exception $e) {
199 199
                 $r = new Response(0, $e->getCode(), $e->getMessage());
200 200
                 // failed processing of HTTP response headers
201 201
                 // save into response obj the full payload received, for debugging
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
         // idea from Luca Mariano <[email protected]> originally in PEARified version of the lib
215 215
         $pos = strrpos($data, '</methodResponse>');
216 216
         if ($pos !== false) {
217
-            $data = substr($data, 0, $pos + 17);
217
+            $data = substr($data, 0, $pos+17);
218 218
         }
219 219
 
220 220
         // try to 'guestimate' the character encoding of the received response
@@ -225,9 +225,9 @@  discard block
 block discarded – undo
225 225
             if ($start) {
226 226
                 $start += strlen('<!-- SERVER DEBUG INFO (BASE64 ENCODED):');
227 227
                 $end = strpos($data, '-->', $start);
228
-                $comments = substr($data, $start, $end - $start);
229
-                Logger::instance()->debugMessage("---SERVER DEBUG INFO (DECODED) ---\n\t" .
230
-                    str_replace("\n", "\n\t", base64_decode($comments)) . "\n---END---", $respEncoding);
228
+                $comments = substr($data, $start, $end-$start);
229
+                Logger::instance()->debugMessage("---SERVER DEBUG INFO (DECODED) ---\n\t".
230
+                    str_replace("\n", "\n\t", base64_decode($comments))."\n---END---", $respEncoding);
231 231
             }
232 232
         }
233 233
 
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
                     if (extension_loaded('mbstring')) {
256 256
                         $data = mb_convert_encoding($data, 'UTF-8', $respEncoding);
257 257
                     } else {
258
-                        error_log('XML-RPC: ' . __METHOD__ . ': invalid charset encoding of received response: ' . $respEncoding);
258
+                        error_log('XML-RPC: '.__METHOD__.': invalid charset encoding of received response: '.$respEncoding);
259 259
                     }
260 260
                 }
261 261
             }
@@ -275,12 +275,12 @@  discard block
 block discarded – undo
275 275
         $xmlRpcParser->parse($data, $returnType, XMLParser::ACCEPT_RESPONSE);
276 276
 
277 277
         // first error check: xml not well formed
278
-        if ($xmlRpcParser->_xh['isf'] > 2) {
278
+        if ($xmlRpcParser->_xh['isf']>2) {
279 279
 
280 280
             // BC break: in the past for some cases we used the error message: 'XML error at line 1, check URL'
281 281
 
282 282
             $r = new Response(0, PhpXmlRpc::$xmlrpcerr['invalid_return'],
283
-                PhpXmlRpc::$xmlrpcstr['invalid_return'] . ' ' . $xmlRpcParser->_xh['isf_reason']);
283
+                PhpXmlRpc::$xmlrpcstr['invalid_return'].' '.$xmlRpcParser->_xh['isf_reason']);
284 284
 
285 285
             if ($this->debug) {
286 286
                 print $xmlRpcParser->_xh['isf_reason'];
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
             }
294 294
 
295 295
             $r = new Response(0, PhpXmlRpc::$xmlrpcerr['invalid_return'],
296
-                PhpXmlRpc::$xmlrpcstr['invalid_return'] . ' ' . $xmlRpcParser->_xh['isf_reason']);
296
+                PhpXmlRpc::$xmlrpcstr['invalid_return'].' '.$xmlRpcParser->_xh['isf_reason']);
297 297
         }
298 298
         // third error check: parsing of the response has somehow gone boink.
299 299
         // NB: shall we omit this check, since we trust the parsing code?
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
             $r = new Response(0, PhpXmlRpc::$xmlrpcerr['invalid_return'],
305 305
                 PhpXmlRpc::$xmlrpcstr['invalid_return']);
306 306
         } else {
307
-            if ($this->debug > 1) {
307
+            if ($this->debug>1) {
308 308
                 Logger::instance()->debugMessage(
309 309
                     "---PARSED---\n".var_export($xmlRpcParser->_xh['value'], true)."\n---END---"
310 310
                 );
Please login to merge, or discard this patch.
src/Encoder.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
                 return $xmlrpcVal->scalarval();
77 77
             case 'array':
78 78
                 $arr = array();
79
-                foreach($xmlrpcVal as $value) {
79
+                foreach ($xmlrpcVal as $value) {
80 80
                     $arr[] = $this->decode($value, $options);
81 81
                 }
82 82
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             case 'msg':
107 107
                 $paramCount = $xmlrpcVal->getNumParams();
108 108
                 $arr = array();
109
-                for ($i = 0; $i < $paramCount; $i++) {
109
+                for ($i = 0; $i<$paramCount; $i++) {
110 110
                     $arr[] = $this->decode($xmlrpcVal->getParam($i), $options);
111 111
                 }
112 112
 
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
                     $xmlrpcVal = new Value($phpVal->format('Ymd\TH:i:s'), Value::$xmlrpcStruct);
185 185
                 } else {
186 186
                     $arr = array();
187
-                    foreach($phpVal as $k => $v) {
187
+                    foreach ($phpVal as $k => $v) {
188 188
                         $arr[$k] = $this->encode($v, $options);
189 189
                     }
190 190
                     $xmlrpcVal = new Value($arr, Value::$xmlrpcStruct);
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
                 break;
207 207
             case 'resource':
208 208
                 if (in_array('extension_api', $options)) {
209
-                    $xmlrpcVal = new Value((int)$phpVal, Value::$xmlrpcInt);
209
+                    $xmlrpcVal = new Value((int) $phpVal, Value::$xmlrpcInt);
210 210
                 } else {
211 211
                     $xmlrpcVal = new Value();
212 212
                 }
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
                     if (extension_loaded('mbstring')) {
252 252
                         $xmlVal = mb_convert_encoding($xmlVal, 'UTF-8', $valEncoding);
253 253
                     } else {
254
-                        error_log('XML-RPC: ' . __METHOD__ . ': invalid charset encoding of xml text: ' . $valEncoding);
254
+                        error_log('XML-RPC: '.__METHOD__.': invalid charset encoding of xml text: '.$valEncoding);
255 255
                     }
256 256
                 }
257 257
             }
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
         $xmlRpcParser = new XMLParser($options);
268 268
         $xmlRpcParser->parse($xmlVal, XMLParser::RETURN_XMLRPCVALS, XMLParser::ACCEPT_REQUEST | XMLParser::ACCEPT_RESPONSE | XMLParser::ACCEPT_VALUE);
269 269
 
270
-        if ($xmlRpcParser->_xh['isf'] > 1) {
270
+        if ($xmlRpcParser->_xh['isf']>1) {
271 271
             // test that $xmlrpc->_xh['value'] is an obj, too???
272 272
 
273 273
             error_log($xmlRpcParser->_xh['isf_reason']);
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
                 return $r;
292 292
             case 'methodcall':
293 293
                 $req = new Request($xmlRpcParser->_xh['method']);
294
-                for ($i = 0; $i < count($xmlRpcParser->_xh['params']); $i++) {
294
+                for ($i = 0; $i<count($xmlRpcParser->_xh['params']); $i++) {
295 295
                     $req->addParam($xmlRpcParser->_xh['params'][$i]);
296 296
                 }
297 297
 
Please login to merge, or discard this patch.