Passed
Push — master ( bb780a...ebcf65 )
by Gaetano
08:40
created
tests/02ValueTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/../lib/xmlrpc.inc';
4
-include_once __DIR__ . '/../lib/xmlrpcs.inc';
3
+include_once __DIR__.'/../lib/xmlrpc.inc';
4
+include_once __DIR__.'/../lib/xmlrpcs.inc';
5 5
 
6
-include_once __DIR__ . '/parse_args.php';
6
+include_once __DIR__.'/parse_args.php';
7 7
 
8
-include_once __DIR__ . '/PolyfillTestCase.php';
8
+include_once __DIR__.'/PolyfillTestCase.php';
9 9
 
10 10
 use PHPUnit\Runner\BaseTestRunner;
11 11
 
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         $this->assertequals(1, count($v1));
129 129
         $out = array('me' => array(), 'mytype' => 2, '_php_class' => null);
130 130
 
131
-        foreach($v1 as $key => $val)
131
+        foreach ($v1 as $key => $val)
132 132
         {
133 133
             $this->assertArrayHasKey($key, $out);
134 134
             $expected = $out[$key];
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
         $this->assertequals(2, count($v2));
144 144
         $out = array(array('key' => 0, 'value'  => 'object'), array('key' => 1, 'value'  => 'object'));
145 145
         $i = 0;
146
-        foreach($v2 as $key => $val)
146
+        foreach ($v2 as $key => $val)
147 147
         {
148 148
             $expected = $out[$i];
149 149
             $this->assertequals($expected['key'], $key);
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     {
158 158
         // nb: make sure that  the serialized xml corresponding to this is > 10MB in size
159 159
         $data = array();
160
-        for ($i = 0; $i < 500000; $i++ ) {
160
+        for ($i = 0; $i<500000; $i++) {
161 161
             $data[] = 'hello world';
162 162
         }
163 163
 
Please login to merge, or discard this patch.
tests/10DemofilesTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/WebTestCase.php';
3
+include_once __DIR__.'/WebTestCase.php';
4 4
 
5 5
 /**
6 6
  * Tests for php files in the 'demo' directory.
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
         $this->args = argParser::getArgs();
13 13
 
14 14
         // assumes HTTPURI to be in the form /tests/index.php?etc...
15
-        $this->baseUrl = $this->args['HTTPSERVER'] . preg_replace('|\?.+|', '', $this->args['HTTPURI']);
16
-        $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . preg_replace('|/tests/index\.php(\?.*)?|', '/tests/phpunit_coverage.php', $this->args['HTTPURI']);
15
+        $this->baseUrl = $this->args['HTTPSERVER'].preg_replace('|\?.+|', '', $this->args['HTTPURI']);
16
+        $this->coverageScriptUrl = 'http://'.$this->args['HTTPSERVER'].preg_replace('|/tests/index\.php(\?.*)?|', '/tests/phpunit_coverage.php', $this->args['HTTPURI']);
17 17
     }
18 18
 
19 19
     public function testVardemo()
Please login to merge, or discard this patch.
tests/03ParsingTest.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/../lib/xmlrpc.inc';
4
-include_once __DIR__ . '/../lib/xmlrpcs.inc';
3
+include_once __DIR__.'/../lib/xmlrpc.inc';
4
+include_once __DIR__.'/../lib/xmlrpcs.inc';
5 5
 
6
-include_once __DIR__ . '/parse_args.php';
6
+include_once __DIR__.'/parse_args.php';
7 7
 
8
-include_once __DIR__ . '/PolyfillTestCase.php';
8
+include_once __DIR__.'/PolyfillTestCase.php';
9 9
 
10 10
 use PHPUnit\Runner\BaseTestRunner;
11 11
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 
130 130
     public function testI8()
131 131
     {
132
-        if (PHP_INT_SIZE == 4 ) {
132
+        if (PHP_INT_SIZE == 4) {
133 133
             $this->markTestSkipped('Can not test i8 as php is compiled in 32 bit mode');
134 134
             return;
135 135
         }
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 
205 205
     public function testUnicodeInMemberName()
206 206
     {
207
-        $str = "G" . chr(252) . "nter, El" . chr(232) . "ne";
207
+        $str = "G".chr(252)."nter, El".chr(232)."ne";
208 208
         $v = array($str => new xmlrpcval(1));
209 209
         $r = new xmlrpcresp(new xmlrpcval($v, 'struct'));
210 210
         $r = $r->serialize();
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         $response = @utf8_encode(
221 221
             '<?xml version="1.0"?>
222 222
 <!-- covers what happens when lib receives UTF8 chars in response text and comments -->
223
-<!-- ' . chr(224) . chr(252) . chr(232) . '&#224;&#252;&#232; -->
223
+<!-- ' . chr(224).chr(252).chr(232).'&#224;&#252;&#232; -->
224 224
 <methodResponse>
225 225
 <fault>
226 226
 <value>
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 </member>
232 232
 <member>
233 233
 <name>faultString</name>
234
-<value><string>' . chr(224) . chr(252) . chr(232) . '&#224;&#252;&#232;</string></value>
234
+<value><string>' . chr(224).chr(252).chr(232).'&#224;&#252;&#232;</string></value>
235 235
 </member>
236 236
 </struct>
237 237
 </value>
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         $m = $this->newRequest('dummy');
241 241
         $r = $m->parseResponse($response);
242 242
         $v = $r->faultString();
243
-        $this->assertEquals(chr(224) . chr(252) . chr(232) . chr(224) . chr(252) . chr(232), $v);
243
+        $this->assertEquals(chr(224).chr(252).chr(232).chr(224).chr(252).chr(232), $v);
244 244
     }
245 245
 
246 246
     public function testBrokenRequests()
@@ -447,8 +447,8 @@  discard block
 block discarded – undo
447 447
         $i = \PhpXmlRpc\PhpXmlRpc::$xmlrpc_reject_invalid_values;
448 448
         \PhpXmlRpc\PhpXmlRpc::$xmlrpc_reject_invalid_values = true;
449 449
 
450
-        foreach($values as $value) {
451
-            $f = '<?xml version="1.0"?><methodResponse><params><param><value>' . $value . '</value></param></params></methodResponse> ';
450
+        foreach ($values as $value) {
451
+            $f = '<?xml version="1.0"?><methodResponse><params><param><value>'.$value.'</value></param></params></methodResponse> ';
452 452
             $r = $s->parseResponse($f);
453 453
             $v = $r->faultCode();
454 454
             $this->assertEquals(2, $v, "Testing $value");
@@ -552,11 +552,11 @@  discard block
 block discarded – undo
552 552
 
553 553
     public function testUTF8Response()
554 554
     {
555
-        $string = chr(224) . chr(252) . chr(232);
555
+        $string = chr(224).chr(252).chr(232);
556 556
 
557 557
         $s = $this->newRequest('dummy');
558
-        $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=UTF-8\r\n\r\n" . '<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
559
-<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . @utf8_encode($string) . '</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
558
+        $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=UTF-8\r\n\r\n".'<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
559
+<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . @utf8_encode($string).'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
560 560
 ';
561 561
         $r = $s->parseResponse($f, false, 'phpvals');
562 562
         $v = $r->value();
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
         $this->assertEquals($string, $v);
565 565
 
566 566
         $f = '<?xml version="1.0" encoding="UTF-8"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
567
-<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . @utf8_encode($string) . '</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
567
+<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . @utf8_encode($string).'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
568 568
 ';
569 569
         $r = $s->parseResponse($f, false, 'phpvals');
570 570
         $v = $r->value();
@@ -580,11 +580,11 @@  discard block
 block discarded – undo
580 580
 
581 581
     public function testLatin1Response()
582 582
     {
583
-        $string = chr(224) . chr(252) . chr(232);
583
+        $string = chr(224).chr(252).chr(232);
584 584
 
585 585
         $s = $this->newRequest('dummy');
586
-        $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=ISO-8859-1\r\n\r\n" . '<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
587
-<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . $string . '</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
586
+        $f = "HTTP/1.1 200 OK\r\nContent-type: text/xml; charset=ISO-8859-1\r\n\r\n".'<?xml version="1.0"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
587
+<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . $string.'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
588 588
 ';
589 589
         $r = $s->parseResponse($f, false, 'phpvals');
590 590
         $v = $r->value();
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
         $this->assertEquals($string, $v);
593 593
 
594 594
         $f = '<?xml version="1.0" encoding="ISO-8859-1"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
595
-<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . $string . '</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
595
+<member><name>dateCreated</name><value><dateTime.iso8601>20011126T09:17:52</dateTime.iso8601></value></member><member><name>content</name><value>' . $string.'</value></member><member><name>postid</name><value>7414222</value></member></struct></value></param></params></methodResponse>
596 596
 ';
597 597
         $r = $s->parseResponse($f, false, 'phpvals');
598 598
         $v = $r->value();
Please login to merge, or discard this patch.
tests/09HTTPTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/../lib/xmlrpc.inc';
4
-include_once __DIR__ . '/../lib/xmlrpc_wrappers.inc';
3
+include_once __DIR__.'/../lib/xmlrpc.inc';
4
+include_once __DIR__.'/../lib/xmlrpc_wrappers.inc';
5 5
 
6
-include_once __DIR__ . '/parse_args.php';
6
+include_once __DIR__.'/parse_args.php';
7 7
 
8
-include_once __DIR__ . '/08ServerTest.php';
8
+include_once __DIR__.'/08ServerTest.php';
9 9
 
10 10
 /**
11 11
  * Tests which stress http features of the library.
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         );
31 31
 
32 32
         $methods = array();
33
-        foreach(get_class_methods('ServerTest') as $method)
33
+        foreach (get_class_methods('ServerTest') as $method)
34 34
         {
35 35
             if (strpos($method, 'test') === 0 && !in_array($method, $unsafeMethods))
36 36
             {
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
                 preg_match('/ubunutu([0-9]+)/', $output[0], $matches);
305 305
                 $ubuntuVersion = @$matches[1];
306 306
             }
307
-            if ($ubuntuVersion >= 20) {
307
+            if ($ubuntuVersion>=20) {
308 308
                 $this->markTestSkipped('HTTPS via Socket known to fail on php less than 7.2 on Ubuntu 20 and higher');
309 309
                 return;
310 310
             }
Please login to merge, or discard this patch.
demo/server/codegen.php 1 patch
Spacing   +17 added lines, -17 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
 require_once __DIR__.'/methodProviders/CommentManager.php';
5 5
 
@@ -25,33 +25,33 @@  discard block
 block discarded – undo
25 25
 // generate a file with a class definition
26 26
 
27 27
 // the generated code does not have an autoloader included - we need to add in one
28
-$autoloader = __DIR__ . "/_prepend.php";
28
+$autoloader = __DIR__."/_prepend.php";
29 29
 
30 30
 file_put_contents($targetClassFile,
31
-    "<?php\n\n" .
32
-    "require_once '$autoloader';\n\n" .
31
+    "<?php\n\n".
32
+    "require_once '$autoloader';\n\n".
33 33
     "class MyServerClass\n{\n\n"
34 34
 ) || die('uh oh');
35 35
 
36 36
 // we mangle a bit the code we get from wrapPhpClass to generate a php class instead of a bunch of functions
37 37
 
38
-foreach($code as $methodName => $methodDef) {
39
-    file_put_contents($targetClassFile, '  ' . str_replace(array('function ', "\n"), array('public static function ', "\n  "), $methodDef['source']) . "\n\n", FILE_APPEND) || die('uh oh');
40
-    $code[$methodName]['function'] = 'MyServerClass::' . $methodDef['function'];
38
+foreach ($code as $methodName => $methodDef) {
39
+    file_put_contents($targetClassFile, '  '.str_replace(array('function ', "\n"), array('public static function ', "\n  "), $methodDef['source'])."\n\n", FILE_APPEND) || die('uh oh');
40
+    $code[$methodName]['function'] = 'MyServerClass::'.$methodDef['function'];
41 41
     unset($code[$methodName]['source']);
42 42
 }
43 43
 file_put_contents($targetClassFile, "}\n", FILE_APPEND) || die('uh oh');
44 44
 
45 45
 // generate separate files with the xml-rpc server instantiation and its dispatch map
46 46
 
47
-file_put_contents($targetDispatchMapFile, "<?php\n\nreturn " . var_export($code, true) . ";\n");
47
+file_put_contents($targetDispatchMapFile, "<?php\n\nreturn ".var_export($code, true).";\n");
48 48
 
49 49
 file_put_contents($targetControllerFile,
50
-    "<?php\n\n" .
50
+    "<?php\n\n".
51 51
 
52
-    "require_once '$autoloader';\n\n" .
52
+    "require_once '$autoloader';\n\n".
53 53
 
54
-    "require_once '$targetClassFile';\n\n" .
54
+    "require_once '$targetClassFile';\n\n".
55 55
 
56 56
     // NB: since we are running the generated code within the same script, the existing CommentManager instance will be
57 57
     // available for usage by the methods of MyServerClass, as we keep a reference to them within the variable Wrapper::$objHolder
@@ -61,12 +61,12 @@  discard block
 block discarded – undo
61 61
     //     Wrapper::holdObject('xmlrpc_CommentManager_addComment', $cm);
62 62
     //     Wrapper::holdObject('xmlrpc_CommentManager_getComments', $cm);
63 63
 
64
-    "\$dm = require_once '$targetDispatchMapFile';\n" .
65
-    '$s = new \PhpXmlRpc\Server($dm, false);' . "\n" .
66
-    '// NB: do not leave these 2 debug lines enabled on publicly accessible servers!' . "\n" .
67
-    '$s->setDebug(2);' . "\n" .
68
-    '$s->exception_handling = 1;' . "\n" .
69
-    '$s->service();' . "\n"
64
+    "\$dm = require_once '$targetDispatchMapFile';\n".
65
+    '$s = new \PhpXmlRpc\Server($dm, false);'."\n".
66
+    '// NB: do not leave these 2 debug lines enabled on publicly accessible servers!'."\n".
67
+    '$s->setDebug(2);'."\n".
68
+    '$s->exception_handling = 1;'."\n".
69
+    '$s->service();'."\n"
70 70
 ) || die('uh oh');
71 71
 
72 72
 // test that everything worked by running it in realtime (note that this will return an xml-rpc error message if run
Please login to merge, or discard this patch.
src/Helper/XMLParser.php 1 patch
Spacing   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -182,12 +182,12 @@  discard block
 block discarded – undo
182 182
         foreach ($mergedOptions as $key => $val) {
183 183
             // q: can php be built without ctype? should we use a regexp?
184 184
             if (is_string($key) && !ctype_digit($key)) {
185
-                switch($key) {
185
+                switch ($key) {
186 186
                     case 'target_charset':
187 187
                         if (function_exists('mb_convert_encoding')) {
188 188
                             $this->current_parsing_options['target_charset'] = $val;
189 189
                         } else {
190
-                            $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ": 'target_charset' option is unsupported without mbstring");
190
+                            $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.": 'target_charset' option is unsupported without mbstring");
191 191
                         }
192 192
                         break;
193 193
 
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
                             //$this->_xh['isf'] = 4;
199 199
                             //$this->_xh['isf_reason'] = "Callback passed as 'methodname_callback' is not callable";
200 200
                             //return;
201
-                            $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ": Callback passed as 'methodname_callback' is not callable");
201
+                            $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.": Callback passed as 'methodname_callback' is not callable");
202 202
                         }
203 203
                         break;
204 204
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
                         break;
210 210
 
211 211
                     default:
212
-                        $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ": unsupported option: $key");
212
+                        $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.": unsupported option: $key");
213 213
                 }
214 214
                 unset($mergedOptions[$key]);
215 215
             }
@@ -255,10 +255,10 @@  discard block
 block discarded – undo
255 255
 
256 256
         try {
257 257
             // @see ticket #70 - we have to parse big xml docs in chunks to avoid errors
258
-            for ($offset = 0; $offset < $len; $offset += $this->maxChunkLength) {
258
+            for ($offset = 0; $offset<$len; $offset += $this->maxChunkLength) {
259 259
                 $chunk = substr($data, $offset, $this->maxChunkLength);
260 260
                 // error handling: xml not well formed
261
-                if (!xml_parse($parser, $chunk, $offset + $this->maxChunkLength >= $len)) {
261
+                if (!xml_parse($parser, $chunk, $offset+$this->maxChunkLength>=$len)) {
262 262
                     $errCode = xml_get_error_code($parser);
263 263
                     $errStr = sprintf('XML error %s: %s at line %d, column %d', $errCode, xml_error_string($errCode),
264 264
                         xml_get_current_line_number($parser), xml_get_current_column_number($parser));
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
                     break;
269 269
                 }
270 270
                 // no need to parse further if we already have a fatal error
271
-                if ($this->_xh['isf'] >= 2) {
271
+                if ($this->_xh['isf']>=2) {
272 272
                     break;
273 273
                 }
274 274
             }
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
     public function xmlrpc_se($parser, $name, $attrs, $acceptSingleVals = false)
301 301
     {
302 302
         // if invalid xml-rpc already detected, skip all processing
303
-        if ($this->_xh['isf'] >= 2) {
303
+        if ($this->_xh['isf']>=2) {
304 304
             return;
305 305
         }
306 306
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
                 $this->_xh['rt'] = strtolower($name);
324 324
             } else {
325 325
                 $this->_xh['isf'] = 2;
326
-                $this->_xh['isf_reason'] = 'missing top level xmlrpc element. Found: ' . $name;
326
+                $this->_xh['isf_reason'] = 'missing top level xmlrpc element. Found: '.$name;
327 327
 
328 328
                 return;
329 329
             }
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
             case 'MEMBER':
427 427
                 // set member name to null, in case we do not find in the xml later on
428 428
                 /// @todo we could reject structs missing a NAME in the MEMBER element
429
-                $this->_xh['valuestack'][count($this->_xh['valuestack']) - 1]['name'] = '';
429
+                $this->_xh['valuestack'][count($this->_xh['valuestack'])-1]['name'] = '';
430 430
                 //$this->_xh['ac']='';
431 431
                 // Drop trough intentionally
432 432
 
@@ -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
 
@@ -577,11 +577,11 @@  discard block
 block discarded – undo
577 577
                     // log if receiving something strange, even though we set the value to false anyway
578 578
                     /// @todo to be consistent with the other types, we should use a value outside the good-value domain, e.g. NULL
579 579
                     if ($this->_xh['ac'] != '0' && strcasecmp($this->_xh['ac'], 'false') !== 0) {
580
-                        $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': invalid data received in BOOLEAN value: ' . $this->_xh['ac']);
580
+                        $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': invalid data received in BOOLEAN value: '.$this->_xh['ac']);
581 581
                         if ($this->current_parsing_options['xmlrpc_reject_invalid_values'])
582 582
                         {
583 583
                             $this->_xh['isf'] = 2;
584
-                            $this->_xh['isf_reason'] = 'Invalid data received in BOOLEAN value: ' . $this->_xh['ac'];
584
+                            $this->_xh['isf_reason'] = 'Invalid data received in BOOLEAN value: '.$this->_xh['ac'];
585 585
                             return;
586 586
                         }
587 587
                     }
@@ -600,18 +600,18 @@  discard block
 block discarded – undo
600 600
                 $this->_xh['vt'] = strtolower($name);
601 601
                 $this->_xh['lv'] = 3; // indicate we've found a value
602 602
                 if (!preg_match(PhpXmlRpc::$xmlrpc_int_format, $this->_xh['ac'])) {
603
-                    $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': non numeric data received in INT: ' . $this->_xh['ac']);
603
+                    $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': non numeric data received in INT: '.$this->_xh['ac']);
604 604
                     if ($this->current_parsing_options['xmlrpc_reject_invalid_values'])
605 605
                     {
606 606
                         $this->_xh['isf'] = 2;
607
-                        $this->_xh['isf_reason'] = 'Non numeric data received in INT value: ' . $this->_xh['ac'];
607
+                        $this->_xh['isf_reason'] = 'Non numeric data received in INT value: '.$this->_xh['ac'];
608 608
                         return;
609 609
                     }
610 610
                     /// @todo: find a better way of reporting an error value than this! Use NaN?
611 611
                     $this->_xh['value'] = 'ERROR_NON_NUMERIC_FOUND';
612 612
                 } else {
613 613
                     // it's ok, add it on
614
-                    $this->_xh['value'] = (int)$this->_xh['ac'];
614
+                    $this->_xh['value'] = (int) $this->_xh['ac'];
615 615
                 }
616 616
                 break;
617 617
 
@@ -619,18 +619,18 @@  discard block
 block discarded – undo
619 619
                 $this->_xh['vt'] = Value::$xmlrpcDouble;
620 620
                 $this->_xh['lv'] = 3; // indicate we've found a value
621 621
                 if (!preg_match(PhpXmlRpc::$xmlrpc_double_format, $this->_xh['ac'])) {
622
-                    $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': non numeric data received in DOUBLE value: ' . $this->_xh['ac']);
622
+                    $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': non numeric data received in DOUBLE value: '.$this->_xh['ac']);
623 623
                     if ($this->current_parsing_options['xmlrpc_reject_invalid_values'])
624 624
                     {
625 625
                         $this->_xh['isf'] = 2;
626
-                        $this->_xh['isf_reason'] = 'Non numeric data received in DOUBLE value: ' . $this->_xh['ac'];
626
+                        $this->_xh['isf_reason'] = 'Non numeric data received in DOUBLE value: '.$this->_xh['ac'];
627 627
                         return;
628 628
                     }
629 629
 
630 630
                     $this->_xh['value'] = 'ERROR_NON_NUMERIC_FOUND';
631 631
                 } else {
632 632
                     // it's ok, add it on
633
-                    $this->_xh['value'] = (double)$this->_xh['ac'];
633
+                    $this->_xh['value'] = (double) $this->_xh['ac'];
634 634
                 }
635 635
                 break;
636 636
 
@@ -638,20 +638,20 @@  discard block
 block discarded – undo
638 638
                 $this->_xh['vt'] = Value::$xmlrpcDateTime;
639 639
                 $this->_xh['lv'] = 3; // indicate we've found a value
640 640
                 if (!preg_match(PhpXmlRpc::$xmlrpc_datetime_format, $this->_xh['ac'])) {
641
-                    $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': invalid data received in DATETIME value: ' . $this->_xh['ac']);
641
+                    $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': invalid data received in DATETIME value: '.$this->_xh['ac']);
642 642
                     if ($this->current_parsing_options['xmlrpc_reject_invalid_values'])
643 643
                     {
644 644
                         $this->_xh['isf'] = 2;
645
-                        $this->_xh['isf_reason'] = 'Invalid data received in DATETIME value: ' . $this->_xh['ac'];
645
+                        $this->_xh['isf_reason'] = 'Invalid data received in DATETIME value: '.$this->_xh['ac'];
646 646
                         return;
647 647
                     }
648 648
                 }
649 649
                 if ($this->current_parsing_options['xmlrpc_return_datetimes']) {
650 650
                     try {
651 651
                         $this->_xh['value'] = new \DateTime($this->_xh['ac']);
652
-                    } catch(\Exception $e) {
652
+                    } catch (\Exception $e) {
653 653
                         // q: what to do? we can not guarantee that a valid date can be created. Return null or throw?
654
-                        $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': ' . $e->getMessage());
654
+                        $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': '.$e->getMessage());
655 655
                         $this->_xh['value'] = null;
656 656
                     }
657 657
                 } else {
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
                 if ($this->current_parsing_options['xmlrpc_reject_invalid_values']) {
666 666
                     $v = base64_decode($this->_xh['ac'], true);
667 667
                     if ($v === false) {
668
-                        $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': invalid data received in BASE64 value');
668
+                        $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': invalid data received in BASE64 value');
669 669
                         $this->_xh['isf'] = 2;
670 670
                         $this->_xh['isf_reason'] = 'Invalid data received in BASE64 value';
671 671
                         return;
@@ -674,14 +674,14 @@  discard block
 block discarded – undo
674 674
                     $v = base64_decode($this->_xh['ac']);
675 675
                     if ($v === '' && $this->_xh['ac'] !== '') {
676 676
                         // only the empty string should decode to the empty string
677
-                        $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': invalid data received in BASE64 value');
677
+                        $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': invalid data received in BASE64 value');
678 678
                     }
679 679
                 }
680 680
                 $this->_xh['value'] = $v;
681 681
                 break;
682 682
 
683 683
             case 'NAME':
684
-                $this->_xh['valuestack'][count($this->_xh['valuestack']) - 1]['name'] = $this->_xh['ac'];
684
+                $this->_xh['valuestack'][count($this->_xh['valuestack'])-1]['name'] = $this->_xh['ac'];
685 685
                 break;
686 686
 
687 687
             case 'MEMBER':
@@ -691,14 +691,14 @@  discard block
 block discarded – undo
691 691
                     // NB: atm we always initialize members with an empty name in xmlrpc__ee, so no need for this check.
692 692
                     // We could make parsing stricter though...
693 693
                     //if (isset($this->_xh['valuestack'][$vscount - 1]['name'])) {
694
-                        $this->_xh['valuestack'][$vscount - 1]['values'][$this->_xh['valuestack'][$vscount - 1]['name']] = $this->_xh['value'];
694
+                        $this->_xh['valuestack'][$vscount-1]['values'][$this->_xh['valuestack'][$vscount-1]['name']] = $this->_xh['value'];
695 695
                     //} else {
696 696
                     //    /// @todo return a parsing error if $this->current_parsing_options['xmlrpc_reject_invalid_values']?
697 697
                     //    $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': missing NAME inside STRUCT in received xml');
698 698
                     //}
699 699
                 } else {
700 700
                     /// @todo return a parsing error $this->current_parsing_options['xmlrpc_reject_invalid_values']?
701
-                    $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': missing VALUE inside STRUCT in received xml');
701
+                    $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': missing VALUE inside STRUCT in received xml');
702 702
                 }
703 703
                 break;
704 704
 
@@ -724,7 +724,7 @@  discard block
 block discarded – undo
724 724
                     $this->_xh['pt'][] = $this->_xh['vt'];
725 725
                 } else {
726 726
                     /// @todo return a parsing error? esp. if if ($this->current_parsing_options['xmlrpc_reject_invalid_values'])
727
-                    $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': missing VALUE inside PARAM in received xml');
727
+                    $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': missing VALUE inside PARAM in received xml');
728 728
                 }
729 729
                 break;
730 730
 
@@ -803,7 +803,7 @@  discard block
 block discarded – undo
803 803
     public function xmlrpc_cd($parser, $data)
804 804
     {
805 805
         // skip processing if xml fault already detected
806
-        if ($this->_xh['isf'] >= 2) {
806
+        if ($this->_xh['isf']>=2) {
807 807
             return;
808 808
         }
809 809
 
@@ -825,7 +825,7 @@  discard block
 block discarded – undo
825 825
     public function xmlrpc_dh($parser, $data)
826 826
     {
827 827
         // skip processing if xml fault already detected
828
-        if ($this->_xh['isf'] >= 2) {
828
+        if ($this->_xh['isf']>=2) {
829 829
             return;
830 830
         }
831 831
 
@@ -899,8 +899,8 @@  discard block
 block discarded – undo
899 899
         // Details:
900 900
         // SPACE:         (#x20 | #x9 | #xD | #xA)+ === [ \x9\xD\xA]+
901 901
         // EQ:            SPACE?=SPACE? === [ \x9\xD\xA]*=[ \x9\xD\xA]*
902
-        if (preg_match('/^<\?xml\s+version\s*=\s*' . "((?:\"[a-zA-Z0-9_.:-]+\")|(?:'[a-zA-Z0-9_.:-]+'))" .
903
-            '\s+encoding\s*=\s*' . "((?:\"[A-Za-z][A-Za-z0-9._-]*\")|(?:'[A-Za-z][A-Za-z0-9._-]*'))/",
902
+        if (preg_match('/^<\?xml\s+version\s*=\s*'."((?:\"[a-zA-Z0-9_.:-]+\")|(?:'[a-zA-Z0-9_.:-]+'))".
903
+            '\s+encoding\s*=\s*'."((?:\"[A-Za-z][A-Za-z0-9._-]*\")|(?:'[A-Za-z][A-Za-z0-9._-]*'))/",
904 904
             $xmlChunk, $matches)) {
905 905
             return strtoupper(substr($matches[2], 1, -1));
906 906
         }
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
             // NB: mb_detect likes to call it ascii, xml parser likes to call it US_ASCII...
919 919
             // IANA also likes better US-ASCII, so go with it
920 920
             if ($enc == 'ASCII') {
921
-                $enc = 'US-' . $enc;
921
+                $enc = 'US-'.$enc;
922 922
             }
923 923
 
924 924
             return $enc;
@@ -955,8 +955,8 @@  discard block
 block discarded – undo
955 955
         // Details:
956 956
         // SPACE:         (#x20 | #x9 | #xD | #xA)+ === [ \x9\xD\xA]+
957 957
         // EQ:            SPACE?=SPACE? === [ \x9\xD\xA]*=[ \x9\xD\xA]*
958
-        if (preg_match('/^<\?xml\s+version\s*=\s*' . "((?:\"[a-zA-Z0-9_.:-]+\")|(?:'[a-zA-Z0-9_.:-]+'))" .
959
-            '\s+encoding\s*=\s*' . "((?:\"[A-Za-z][A-Za-z0-9._-]*\")|(?:'[A-Za-z][A-Za-z0-9._-]*'))/",
958
+        if (preg_match('/^<\?xml\s+version\s*=\s*'."((?:\"[a-zA-Z0-9_.:-]+\")|(?:'[a-zA-Z0-9_.:-]+'))".
959
+            '\s+encoding\s*=\s*'."((?:\"[A-Za-z][A-Za-z0-9._-]*\")|(?:'[A-Za-z][A-Za-z0-9._-]*'))/",
960 960
             $xmlChunk)) {
961 961
             return true;
962 962
         }
@@ -976,7 +976,7 @@  discard block
 block discarded – undo
976 976
                 break;
977 977
             default:
978 978
                 $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
979
-                trigger_error('Undefined property via __set(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING);
979
+                trigger_error('Undefined property via __set(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING);
980 980
         }
981 981
     }
982 982
 
@@ -1000,7 +1000,7 @@  discard block
 block discarded – undo
1000 1000
                 break;
1001 1001
             default:
1002 1002
                 $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
1003
-                trigger_error('Undefined property via __unset(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING);
1003
+                trigger_error('Undefined property via __unset(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING);
1004 1004
         }
1005 1005
     }
1006 1006
 }
Please login to merge, or discard this patch.