Passed
Push — master ( 5d18c7...8ff19d )
by Gaetano
09:55
created
demo/server/methodProviders/wrapper.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -26,11 +26,11 @@  discard block
 block discarded – undo
26 26
  */
27 27
 function plain_findstate($stateNo)
28 28
 {
29
-     if (isset(exampleMethods::$stateNames[$stateNo - 1])) {
30
-        return exampleMethods::$stateNames[$stateNo - 1];
29
+     if (isset(exampleMethods::$stateNames[$stateNo-1])) {
30
+        return exampleMethods::$stateNames[$stateNo-1];
31 31
     } else {
32 32
         // not, there so complain
33
-        throw new Exception("I don't have a state for the index '" . $stateNo . "'", PhpXmlRpc\PhpXmlRpc::$xmlrpcerruser);
33
+        throw new Exception("I don't have a state for the index '".$stateNo."'", PhpXmlRpc\PhpXmlRpc::$xmlrpcerruser);
34 34
     }
35 35
 }
36 36
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         if ($req->getNumParams()) {
70 70
             $p1 = $req->getParam(0);
71 71
             if ($p1->kindOf() === 'scalar') {
72
-                $errNum = (int)$p1->scalarval();
72
+                $errNum = (int) $p1->scalarval();
73 73
             }
74 74
         }
75 75
         throw new Exception("it's just a test", $errNum);
@@ -141,13 +141,13 @@  discard block
 block discarded – undo
141 141
 
142 142
 $findstate10_sig = array(
143 143
     /// @todo add a demo and test with closure usage
144
-    "function" => function ($req) { return exampleMethods::findState($req); },
144
+    "function" => function($req) { return exampleMethods::findState($req); },
145 145
     "signature" => array(array(Value::$xmlrpcString, Value::$xmlrpcInt)),
146
-    "docstring" => 'When passed an integer between 1 and 51 returns the name of a US state, where the integer is the ' .
146
+    "docstring" => 'When passed an integer between 1 and 51 returns the name of a US state, where the integer is the '.
147 147
         'index of that state name in an alphabetic order.',
148 148
 );
149 149
 
150
-$findstate11_sig = $wrapper->wrapPhpFunction(function ($stateNo) { return plain_findstate($stateNo); });
150
+$findstate11_sig = $wrapper->wrapPhpFunction(function($stateNo) { return plain_findstate($stateNo); });
151 151
 
152 152
 /// @todo do we really need a new instance ?
153 153
 $c = new handlersContainer();
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
 $namespaceSignatures = $wrapper->wrapPhpClass($c, array('prefix' => 'namespacetest.', 'replace_class_name' => true, 'method_filter' => '/^findState$/', 'method_type' => 'static'));
158 158
 
159
-$returnObj_sig =  $wrapper->wrapPhpFunction(array($c, 'returnObject'), '', array('encode_php_objs' => true));
159
+$returnObj_sig = $wrapper->wrapPhpFunction(array($c, 'returnObject'), '', array('encode_php_objs' => true));
160 160
 
161 161
 return array_merge(
162 162
     array(
Please login to merge, or discard this patch.
tests/12ExtraFilesTest.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 'extras' 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 = 'http://' . $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 = 'http://'.$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 testBenchmark()
Please login to merge, or discard this patch.
tests/07ClientTest.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once __DIR__ . '/../lib/xmlrpc.inc';
3
+include_once __DIR__.'/../lib/xmlrpc.inc';
4 4
 
5
-include_once __DIR__ . '/parse_args.php';
5
+include_once __DIR__.'/parse_args.php';
6 6
 
7
-include_once __DIR__ . '/PolyfillTestCase.php';
7
+include_once __DIR__.'/PolyfillTestCase.php';
8 8
 
9 9
 use PHPUnit\Runner\BaseTestRunner;
10 10
 
@@ -26,13 +26,13 @@  discard block
 block discarded – undo
26 26
         $this->client->setDebug($this->args['DEBUG']);
27 27
 
28 28
         // in debug mode, the client will be very verbose. Avoid showing its output unless there are errors
29
-        if ($this->args['DEBUG'] >= 1)
29
+        if ($this->args['DEBUG']>=1)
30 30
             ob_start();
31 31
     }
32 32
 
33 33
     protected function tear_down()
34 34
     {
35
-        if ($this->args['DEBUG'] < 1)
35
+        if ($this->args['DEBUG']<1)
36 36
             return;
37 37
         $out = ob_get_clean();
38 38
         $status = $this->getStatus();
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $this->client->server .= 'XXX';
60 60
         $dnsinfo = @dns_get_record($this->client->server);
61 61
         if ($dnsinfo) {
62
-            $this->markTestSkipped('Seems like there is a catchall DNS in effect: host ' . $this->client->server . ' found');
62
+            $this->markTestSkipped('Seems like there is a catchall DNS in effect: host '.$this->client->server.' found');
63 63
         } else {
64 64
             $r = $this->client->send($m, 5);
65 65
             // make sure there's no freaking catchall DNS in effect
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
         // now test a successful connection
88 88
         $server = explode(':', $this->args['HTTPSERVER']);
89
-        if (count($server) > 1) {
89
+        if (count($server)>1) {
90 90
             $this->client->port = $server[1];
91 91
         }
92 92
         $this->client->server = $server[0];
Please login to merge, or discard this patch.
tests/08ServerTest.php 1 patch
Spacing   +34 added lines, -34 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__ . '/PolyfillTestCase.php';
8
+include_once __DIR__.'/PolyfillTestCase.php';
9 9
 
10 10
 use PHPUnit\Extensions\SeleniumCommon\RemoteCoverage;
11 11
 use PHPUnit\Framework\TestResult;
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         // (but only if not called from subclass objects / multitests)
43 43
         if (function_exists('debug_backtrace') && strtolower(get_called_class()) == 'localhosttests') {
44 44
             $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
45
-            for ($i = 0; $i < count($trace); $i++) {
45
+            for ($i = 0; $i<count($trace); $i++) {
46 46
                 if (strpos($trace[$i]['function'], 'test') === 0) {
47 47
                     self::$failed_tests[$trace[$i]['function']] = true;
48 48
                     break;
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function _run($result = NULL)
67 67
     {
68
-        $this->testId = get_class($this) . '__' . $this->getName();
68
+        $this->testId = get_class($this).'__'.$this->getName();
69 69
 
70 70
         if ($result === NULL) {
71 71
             $result = $this->createResult();
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         $this->args = argParser::getArgs();
97 97
 
98 98
         $server = explode(':', $this->args['HTTPSERVER']);
99
-        if (count($server) > 1) {
99
+        if (count($server)>1) {
100 100
             $this->client = new xmlrpc_client($this->args['HTTPURI'], $server[0], $server[1]);
101 101
         } else {
102 102
             $this->client = new xmlrpc_client($this->args['HTTPURI'], $this->args['HTTPSERVER']);
@@ -106,16 +106,16 @@  discard block
 block discarded – undo
106 106
         $this->client->request_compression = $this->request_compression;
107 107
         $this->client->accepted_compression = $this->accepted_compression;
108 108
 
109
-        $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . preg_replace('|/tests/index\.php(\?.*)?|', '/tests/phpunit_coverage.php', $this->args['HTTPURI']);
109
+        $this->coverageScriptUrl = 'http://'.$this->args['HTTPSERVER'].preg_replace('|/tests/index\.php(\?.*)?|', '/tests/phpunit_coverage.php', $this->args['HTTPURI']);
110 110
 
111 111
         // in debug mode, the client will be very verbose. Avoid showing its output unless there are errors
112
-        if ($this->args['DEBUG'] >= 1)
112
+        if ($this->args['DEBUG']>=1)
113 113
             ob_start();
114 114
     }
115 115
 
116 116
     protected function tear_down()
117 117
     {
118
-        if ($this->args['DEBUG'] < 1)
118
+        if ($this->args['DEBUG']<1)
119 119
             return;
120 120
         $out = ob_get_clean();
121 121
         $status = $this->getStatus();
@@ -144,9 +144,9 @@  discard block
 block discarded – undo
144 144
         }
145 145
         $this->validateResponse($r);
146 146
         if (is_array($errorCode)) {
147
-            $this->assertContains($r->faultCode(), $errorCode, 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString());
147
+            $this->assertContains($r->faultCode(), $errorCode, 'Error '.$r->faultCode().' connecting to server: '.$r->faultString());
148 148
         } else {
149
-            $this->assertEquals($errorCode, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString());
149
+            $this->assertEquals($errorCode, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString());
150 150
         }
151 151
         if (!$r->faultCode()) {
152 152
             if ($returnResponse) {
@@ -173,20 +173,20 @@  discard block
 block discarded – undo
173 173
         $query = parse_url($this->client->path, PHP_URL_QUERY);
174 174
         parse_str($query, $vars);
175 175
         $query = http_build_query(array_merge($vars, $data));
176
-        $this->client->path = parse_url($this->client->path, PHP_URL_PATH) . '?' . $query;
176
+        $this->client->path = parse_url($this->client->path, PHP_URL_PATH).'?'.$query;
177 177
     }
178 178
 
179 179
     public function testString()
180 180
     {
181
-        $sendString = "here are 3 \"entities\": < > & " .
182
-            "and here's a dollar sign: \$pretendvarname and a backslash too: " . chr(92) .
183
-            " - isn't that great? \\\"hackery\\\" at it's best " .
184
-            " also don't want to miss out on \$item[0]. " .
185
-            "The real weird stuff follows: CRLF here" . chr(13) . chr(10) .
186
-            "a simple CR here" . chr(13) .
187
-            "a simple LF here" . chr(10) .
188
-            "and then LFCR" . chr(10) . chr(13) .
189
-            "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne, and an xml comment closing tag: -->";
181
+        $sendString = "here are 3 \"entities\": < > & ".
182
+            "and here's a dollar sign: \$pretendvarname and a backslash too: ".chr(92).
183
+            " - isn't that great? \\\"hackery\\\" at it's best ".
184
+            " also don't want to miss out on \$item[0]. ".
185
+            "The real weird stuff follows: CRLF here".chr(13).chr(10).
186
+            "a simple CR here".chr(13).
187
+            "a simple LF here".chr(10).
188
+            "and then LFCR".chr(10).chr(13).
189
+            "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne, and an xml comment closing tag: -->";
190 190
         $m = new xmlrpcmsg('examples.stringecho', array(
191 191
             new xmlrpcval($sendString, 'string'),
192 192
         ));
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
     public function testLatin1String()
208 208
     {
209 209
         $sendString =
210
-            "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne";
210
+            "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne";
211 211
         $x = '<?xml version="1.0" encoding="ISO-8859-1"?><methodCall><methodName>examples.stringecho</methodName><params><param><value>'.
212 212
             $sendString.
213 213
             '</value></param></params></methodCall>';
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
     public function testUtf8Method()
317 317
     {
318 318
         PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding = 'UTF-8';
319
-        $m = new xmlrpcmsg("tests.utf8methodname." . 'κόσμε', array(
319
+        $m = new xmlrpcmsg("tests.utf8methodname.".'κόσμε', array(
320 320
             new xmlrpcval('hello')
321 321
         ));
322 322
         $v = $this->send($m);
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
         ));
339 339
         $v = $this->send($m);
340 340
         if ($v) {
341
-            $this->assertEquals($a + $b, $v->scalarval());
341
+            $this->assertEquals($a+$b, $v->scalarval());
342 342
         }
343 343
     }
344 344
 
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
         ));
351 351
         $v = $this->send($m);
352 352
         if ($v) {
353
-            $this->assertEquals(12 - 23, $v->scalarval());
353
+            $this->assertEquals(12-23, $v->scalarval());
354 354
         }
355 355
     }
356 356
 
@@ -389,7 +389,7 @@  discard block
 block discarded – undo
389 389
         if ($v) {
390 390
             $sz = $v->arraysize();
391 391
             $got = '';
392
-            for ($i = 0; $i < $sz; $i++) {
392
+            for ($i = 0; $i<$sz; $i++) {
393 393
                 $b = $v->arraymem($i);
394 394
                 if ($b->scalarval()) {
395 395
                     $got .= '1';
@@ -452,7 +452,7 @@  discard block
 block discarded – undo
452 452
             $got = '';
453 453
             $expected = '37210';
454 454
             $expect_array = array('ctLeftAngleBrackets', 'ctRightAngleBrackets', 'ctAmpersands', 'ctApostrophes', 'ctQuotes');
455
-            foreach($expect_array as $val) {
455
+            foreach ($expect_array as $val) {
456 456
                 $b = $v->structmem($val);
457 457
                 $got .= $b->me['int'];
458 458
             }
@@ -947,7 +947,7 @@  discard block
 block discarded – undo
947 947
     {
948 948
         // make a 'deep client copy' as the original one might have many properties set
949 949
         // also for speed only wrap one method of the whole server
950
-        $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/' ));
950
+        $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/'));
951 951
         if ($class == '') {
952 952
             $this->fail('Registration of remote server failed');
953 953
         } else {
@@ -986,9 +986,9 @@  discard block
 block discarded – undo
986 986
         $cookies = array(
987 987
             //'c1' => array(),
988 988
             'c2' => array('value' => 'c2'),
989
-            'c3' => array('value' => 'c3', 'expires' => time() + 60 * 60 * 24 * 30),
990
-            'c4' => array('value' => 'c4', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/'),
991
-            'c5' => array('value' => 'c5', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'),
989
+            'c3' => array('value' => 'c3', 'expires' => time()+60 * 60 * 24 * 30),
990
+            'c4' => array('value' => 'c4', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/'),
991
+            'c5' => array('value' => 'c5', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'),
992 992
         );
993 993
         $cookiesval = php_xmlrpc_encode($cookies);
994 994
         $m = new xmlrpcmsg('tests.setcookies', array($cookiesval));
@@ -1036,10 +1036,10 @@  discard block
 block discarded – undo
1036 1036
         $m = new xmlrpcmsg('tests.getcookies', array());
1037 1037
         foreach ($cookies as $cookie => $val) {
1038 1038
             $this->client->setCookie($cookie, $val);
1039
-            $cookies[$cookie] = (string)$cookies[$cookie];
1039
+            $cookies[$cookie] = (string) $cookies[$cookie];
1040 1040
         }
1041 1041
         $r = $this->client->send($m, $this->timeout, $this->method);
1042
-        $this->assertEquals(0, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString());
1042
+        $this->assertEquals(0, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString());
1043 1043
         if (!$r->faultCode()) {
1044 1044
             $v = $r->value();
1045 1045
             $v = php_xmlrpc_decode($v);
Please login to merge, or discard this patch.
tests/03ParsingTest.php 1 patch
Spacing   +21 added lines, -21 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
 
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
     {
23 23
         $this->args = argParser::getArgs();
24 24
         // hide parsing errors unless in debug mode
25
-        if ($this->args['DEBUG'] < 1)
25
+        if ($this->args['DEBUG']<1)
26 26
             ob_start();
27 27
     }
28 28
 
29 29
     protected function tear_down()
30 30
     {
31
-        if ($this->args['DEBUG'] >= 1)
31
+        if ($this->args['DEBUG']>=1)
32 32
             return;
33 33
         $out = ob_get_clean();
34 34
         $status = $this->getStatus();
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
     public function testI8()
132 132
     {
133
-        if (PHP_INT_SIZE == 4 ) {
133
+        if (PHP_INT_SIZE == 4) {
134 134
             $this->markTestSkipped('Can not test i8 as php is compiled in 32 bit mode');
135 135
             return;
136 136
         }
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 
206 206
     public function testUnicodeInMemberName()
207 207
     {
208
-        $str = "G" . chr(252) . "nter, El" . chr(232) . "ne";
208
+        $str = "G".chr(252)."nter, El".chr(232)."ne";
209 209
         $v = array($str => new xmlrpcval(1));
210 210
         $r = new xmlrpcresp(new xmlrpcval($v, 'struct'));
211 211
         $r = $r->serialize();
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
         $response = @utf8_encode(
222 222
             '<?xml version="1.0"?>
223 223
 <!-- covers what happens when lib receives UTF8 chars in response text and comments -->
224
-<!-- ' . chr(224) . chr(252) . chr(232) . '&#224;&#252;&#232; -->
224
+<!-- ' . chr(224).chr(252).chr(232).'&#224;&#252;&#232; -->
225 225
 <methodResponse>
226 226
 <fault>
227 227
 <value>
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 </member>
233 233
 <member>
234 234
 <name>faultString</name>
235
-<value><string>' . chr(224) . chr(252) . chr(232) . '&#224;&#252;&#232;</string></value>
235
+<value><string>' . chr(224).chr(252).chr(232).'&#224;&#252;&#232;</string></value>
236 236
 </member>
237 237
 </struct>
238 238
 </value>
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
         $m = $this->newRequest('dummy');
242 242
         $r = $m->parseResponse($response);
243 243
         $v = $r->faultString();
244
-        $this->assertEquals(chr(224) . chr(252) . chr(232) . chr(224) . chr(252) . chr(232), $v);
244
+        $this->assertEquals(chr(224).chr(252).chr(232).chr(224).chr(252).chr(232), $v);
245 245
     }
246 246
 
247 247
     public function testBrokenRequests()
@@ -448,8 +448,8 @@  discard block
 block discarded – undo
448 448
         $i = \PhpXmlRpc\PhpXmlRpc::$xmlrpc_reject_invalid_values;
449 449
         \PhpXmlRpc\PhpXmlRpc::$xmlrpc_reject_invalid_values = true;
450 450
 
451
-        foreach($values as $value) {
452
-            $f = '<?xml version="1.0"?><methodResponse><params><param><value>' . $value . '</value></param></params></methodResponse> ';
451
+        foreach ($values as $value) {
452
+            $f = '<?xml version="1.0"?><methodResponse><params><param><value>'.$value.'</value></param></params></methodResponse> ';
453 453
             $r = $s->parseResponse($f);
454 454
             $v = $r->faultCode();
455 455
             $this->assertEquals(2, $v, "Testing $value");
@@ -553,11 +553,11 @@  discard block
 block discarded – undo
553 553
 
554 554
     public function testUTF8Response()
555 555
     {
556
-        $string = chr(224) . chr(252) . chr(232);
556
+        $string = chr(224).chr(252).chr(232);
557 557
 
558 558
         $s = $this->newRequest('dummy');
559
-        $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>
560
-<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>
559
+        $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>
560
+<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>
561 561
 ';
562 562
         $r = $s->parseResponse($f, false, 'phpvals');
563 563
         $v = $r->value();
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
         $this->assertEquals($string, $v);
566 566
 
567 567
         $f = '<?xml version="1.0" encoding="UTF-8"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
568
-<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
+<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>
569 569
 ';
570 570
         $r = $s->parseResponse($f, false, 'phpvals');
571 571
         $v = $r->value();
@@ -581,11 +581,11 @@  discard block
 block discarded – undo
581 581
 
582 582
     public function testLatin1Response()
583 583
     {
584
-        $string = chr(224) . chr(252) . chr(232);
584
+        $string = chr(224).chr(252).chr(232);
585 585
 
586 586
         $s = $this->newRequest('dummy');
587
-        $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>
588
-<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>
587
+        $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>
588
+<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>
589 589
 ';
590 590
         $r = $s->parseResponse($f, false, 'phpvals');
591 591
         $v = $r->value();
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
         $this->assertEquals($string, $v);
594 594
 
595 595
         $f = '<?xml version="1.0" encoding="ISO-8859-1"?><methodResponse><params><param><value><struct><member><name>userid</name><value>311127</value></member>
596
-<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
+<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>
597 597
 ';
598 598
         $r = $s->parseResponse($f, false, 'phpvals');
599 599
         $v = $r->value();
Please login to merge, or discard this patch.
demo/server/server.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
     }
25 25
 }
26 26
 
27
-require_once __DIR__ . "/_prepend.php";
27
+require_once __DIR__."/_prepend.php";
28 28
 
29 29
 use PhpXmlRpc\PhpXmlRpc;
30 30
 use PhpXmlRpc\Server;
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         } elseif ($_GET['FORCE_AUTH'] == 'Digest') {
84 84
             if (empty($_SERVER['PHP_AUTH_DIGEST'])) {
85 85
                 header('HTTP/1.1 401 Unauthorized');
86
-                header('WWW-Authenticate: Digest realm="Phpxmlrpc Digest Realm",qop="auth",nonce="' . uniqid() . '",opaque="' . md5('Phpxmlrpc Digest Realm') . '"');
86
+                header('WWW-Authenticate: Digest realm="Phpxmlrpc Digest Realm",qop="auth",nonce="'.uniqid().'",opaque="'.md5('Phpxmlrpc Digest Realm').'"');
87 87
                 die('Text visible if user hits Cancel button');
88 88
             }
89 89
         }
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
     if (isset($_GET['FORCE_REDIRECT'])) {
92 92
         header('HTTP/1.0 302 Found');
93 93
         unset($_GET['FORCE_REDIRECT']);
94
-        header('Location: ' . $_SERVER['REQUEST_URI'] . (count($_GET) ? '?' . http_build_query($_GET) : ''));
94
+        header('Location: '.$_SERVER['REQUEST_URI'].(count($_GET) ? '?'.http_build_query($_GET) : ''));
95 95
         die();
96 96
     }
97 97
 }
Please login to merge, or discard this patch.
tests/04LoggerTest.php 1 patch
Spacing   +4 added lines, -4 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__ . '/PolyfillTestCase.php';
3
+include_once __DIR__.'/PolyfillTestCase.php';
4 4
 
5 5
 use PhpXmlRpc\Helper\Charset;
6 6
 use PhpXmlRpc\Helper\Http;
@@ -38,9 +38,9 @@  discard block
 block discarded – undo
38 38
         $l = $h->getLogger();
39 39
         Http::setLogger($this);
40 40
 
41
-        $s = "HTTP/1.0 200 OK\r\n" .
42
-            "Content-Type: unknown\r\n" .
43
-            "\r\n" .
41
+        $s = "HTTP/1.0 200 OK\r\n".
42
+            "Content-Type: unknown\r\n".
43
+            "\r\n".
44 44
             "body";
45 45
         ob_start();
46 46
         $h->parseResponseHeaders($s, false, 1);
Please login to merge, or discard this patch.
demo/client/_prepend.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 }
9 9
 
10 10
 // Use the custom class autoloader. These two lines are not needed when the phpxmlrpc library is installed using Composer
11
-include_once __DIR__ . '/../../src/Autoloader.php';
11
+include_once __DIR__.'/../../src/Autoloader.php';
12 12
 PhpXmlRpc\Autoloader::register();
13 13
 
14 14
 // Let unit tests run against localhost, 'plain' demos against a known public server
@@ -22,5 +22,5 @@  discard block
 block discarded – undo
22 22
 function output($text)
23 23
 {
24 24
     /// @todo we should only strip html tags, and let through all xml tags
25
-    echo PHP_SAPI == 'cli' ? strip_tags(str_replace(array('<br/>','<br>'), "\n", $text)) : $text;
25
+    echo PHP_SAPI == 'cli' ? strip_tags(str_replace(array('<br/>', '<br>'), "\n", $text)) : $text;
26 26
 }
Please login to merge, or discard this patch.
demo/client/loggerinjection.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-require_once __DIR__ . "/_prepend.php";
2
+require_once __DIR__."/_prepend.php";
3 3
 
4 4
 /**
5 5
  * Demoing how to inject a custom logger for use by the library
@@ -22,13 +22,13 @@  discard block
 block discarded – undo
22 22
     // logger API
23 23
     public function debug($message, $context = array())
24 24
     {
25
-        $this->debugBuffer .= $message . "\n";
25
+        $this->debugBuffer .= $message."\n";
26 26
     }
27 27
 
28 28
     // logger API
29 29
     public function error($message, $context = array())
30 30
     {
31
-        $this->errorBuffer .= $message . "\n";
31
+        $this->errorBuffer .= $message."\n";
32 32
     }
33 33
 
34 34
     public function getDebug()
@@ -59,8 +59,8 @@  discard block
 block discarded – undo
59 59
 
60 60
 $input = array(
61 61
     array('name' => 'Dave', 'age' => 24),
62
-    array('name' => 'Edd',  'age' => 45),
63
-    array('name' => 'Joe',  'age' => 37),
62
+    array('name' => 'Edd', 'age' => 45),
63
+    array('name' => 'Joe', 'age' => 37),
64 64
     array('name' => 'Fred', 'age' => 27),
65 65
 );
66 66
 
@@ -79,5 +79,5 @@  discard block
 block discarded – undo
79 79
 $response = $client->send($request);
80 80
 output("Response received.<br>");
81 81
 
82
-output("The client error info is:<pre>\n" . $logger->getError() . "\n</pre>");
83
-output("The client debug info is:<pre>\n" . $logger->getDebug() . "\n</pre>");
82
+output("The client error info is:<pre>\n".$logger->getError()."\n</pre>");
83
+output("The client debug info is:<pre>\n".$logger->getDebug()."\n</pre>");
Please login to merge, or discard this patch.