@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | $this->me['struct'] = $val; |
120 | 120 | break; |
121 | 121 | default: |
122 | - $this->getLogger()->errorLog("XML-RPC: " . __METHOD__ . ": not a known type ($type)"); |
|
122 | + $this->getLogger()->errorLog("XML-RPC: ".__METHOD__.": not a known type ($type)"); |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | } |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | if ($typeOf !== 1) { |
147 | - $this->getLogger()->errorLog("XML-RPC: " . __METHOD__ . ": not a scalar type ($type)"); |
|
147 | + $this->getLogger()->errorLog("XML-RPC: ".__METHOD__.": not a scalar type ($type)"); |
|
148 | 148 | return 0; |
149 | 149 | } |
150 | 150 | |
@@ -161,10 +161,10 @@ discard block |
||
161 | 161 | |
162 | 162 | switch ($this->mytype) { |
163 | 163 | case 1: |
164 | - $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': scalar xmlrpc value can have only one value'); |
|
164 | + $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': scalar xmlrpc value can have only one value'); |
|
165 | 165 | return 0; |
166 | 166 | case 3: |
167 | - $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': cannot add anonymous scalar to struct xmlrpc value'); |
|
167 | + $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': cannot add anonymous scalar to struct xmlrpc value'); |
|
168 | 168 | return 0; |
169 | 169 | case 2: |
170 | 170 | // we're adding a scalar value to an array here |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | |
207 | 207 | return 1; |
208 | 208 | } else { |
209 | - $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']'); |
|
209 | + $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']'); |
|
210 | 210 | return 0; |
211 | 211 | } |
212 | 212 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | |
238 | 238 | return 1; |
239 | 239 | } else { |
240 | - $this->getLogger()->errorLog('XML-RPC: ' . __METHOD__ . ': already initialized as a [' . $this->kindOf() . ']'); |
|
240 | + $this->getLogger()->errorLog('XML-RPC: '.__METHOD__.': already initialized as a ['.$this->kindOf().']'); |
|
241 | 241 | return 0; |
242 | 242 | } |
243 | 243 | } |
@@ -280,19 +280,19 @@ discard block |
||
280 | 280 | case 1: |
281 | 281 | switch ($typ) { |
282 | 282 | case static::$xmlrpcBase64: |
283 | - $rs .= "<{$typ}>" . base64_encode($val) . "</{$typ}>"; |
|
283 | + $rs .= "<{$typ}>".base64_encode($val)."</{$typ}>"; |
|
284 | 284 | break; |
285 | 285 | case static::$xmlrpcBoolean: |
286 | - $rs .= "<{$typ}>" . ($val ? '1' : '0') . "</{$typ}>"; |
|
286 | + $rs .= "<{$typ}>".($val ? '1' : '0')."</{$typ}>"; |
|
287 | 287 | break; |
288 | 288 | case static::$xmlrpcString: |
289 | 289 | // Do NOT use htmlentities, since it will produce named html entities, which are invalid xml |
290 | - $rs .= "<{$typ}>" . $this->getCharsetEncoder()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</{$typ}>"; |
|
290 | + $rs .= "<{$typ}>".$this->getCharsetEncoder()->encodeEntities($val, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</{$typ}>"; |
|
291 | 291 | break; |
292 | 292 | case static::$xmlrpcInt: |
293 | 293 | case static::$xmlrpcI4: |
294 | 294 | case static::$xmlrpcI8: |
295 | - $rs .= "<{$typ}>" . (int)$val . "</{$typ}>"; |
|
295 | + $rs .= "<{$typ}>".(int) $val."</{$typ}>"; |
|
296 | 296 | break; |
297 | 297 | case static::$xmlrpcDouble: |
298 | 298 | // avoid using standard conversion of float to string because it is locale-dependent, |
@@ -300,16 +300,16 @@ discard block |
||
300 | 300 | // sprintf('%F') could be most likely ok, but it fails eg. on 2e-14. |
301 | 301 | // The code below tries its best at keeping max precision while avoiding exp notation, |
302 | 302 | // but there is of course no limit in the number of decimal places to be used... |
303 | - $rs .= "<{$typ}>" . preg_replace('/\\.?0+$/', '', number_format((double)$val, PhpXmlRpc::$xmlpc_double_precision, '.', '')) . "</{$typ}>"; |
|
303 | + $rs .= "<{$typ}>".preg_replace('/\\.?0+$/', '', number_format((double) $val, PhpXmlRpc::$xmlpc_double_precision, '.', ''))."</{$typ}>"; |
|
304 | 304 | break; |
305 | 305 | case static::$xmlrpcDateTime: |
306 | 306 | if (is_string($val)) { |
307 | 307 | $rs .= "<{$typ}>{$val}</{$typ}>"; |
308 | 308 | // DateTimeInterface is not present in php 5.4... |
309 | 309 | } elseif (is_a($val, 'DateTimeInterface') || is_a($val, 'DateTime')) { |
310 | - $rs .= "<{$typ}>" . $val->format('Ymd\TH:i:s') . "</{$typ}>"; |
|
310 | + $rs .= "<{$typ}>".$val->format('Ymd\TH:i:s')."</{$typ}>"; |
|
311 | 311 | } elseif (is_int($val)) { |
312 | - $rs .= "<{$typ}>" . date('Ymd\TH:i:s', $val) . "</{$typ}>"; |
|
312 | + $rs .= "<{$typ}>".date('Ymd\TH:i:s', $val)."</{$typ}>"; |
|
313 | 313 | } else { |
314 | 314 | // not really a good idea here: but what should we output anyway? left for backward compat... |
315 | 315 | $rs .= "<{$typ}>{$val}</{$typ}>"; |
@@ -331,14 +331,14 @@ discard block |
||
331 | 331 | case 3: |
332 | 332 | // struct |
333 | 333 | if ($this->_php_class) { |
334 | - $rs .= '<struct php_class="' . $this->_php_class . "\">\n"; |
|
334 | + $rs .= '<struct php_class="'.$this->_php_class."\">\n"; |
|
335 | 335 | } else { |
336 | 336 | $rs .= "<struct>\n"; |
337 | 337 | } |
338 | 338 | $charsetEncoder = $this->getCharsetEncoder(); |
339 | 339 | /** @var Value $val2 */ |
340 | 340 | foreach ($val as $key2 => $val2) { |
341 | - $rs .= '<member><name>' . $charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "</name>\n"; |
|
341 | + $rs .= '<member><name>'.$charsetEncoder->encodeEntities($key2, PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."</name>\n"; |
|
342 | 342 | //$rs.=$this->serializeval($val2); |
343 | 343 | $rs .= $val2->serialize($charsetEncoding); |
344 | 344 | $rs .= "</member>\n"; |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $val = reset($this->me); |
375 | 375 | $typ = key($this->me); |
376 | 376 | |
377 | - return '<value>' . $this->serializedata($typ, $val, $charsetEncoding) . "</value>\n"; |
|
377 | + return '<value>'.$this->serializedata($typ, $val, $charsetEncoding)."</value>\n"; |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | /** |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -require_once __DIR__ . "/_prepend.php"; |
|
2 | +require_once __DIR__."/_prepend.php"; |
|
3 | 3 | |
4 | 4 | use PhpXmlRpc\Encoder; |
5 | 5 | use PhpXmlRpc\Client; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $handles = array(); |
25 | 25 | $curl = curl_multi_init(); |
26 | 26 | |
27 | - foreach($requests as $k => $req) { |
|
27 | + foreach ($requests as $k => $req) { |
|
28 | 28 | $req->setDebug($this->debug); |
29 | 29 | |
30 | 30 | $handle = $this->prepareCurlHandle( |
@@ -57,19 +57,19 @@ discard block |
||
57 | 57 | $running = 0; |
58 | 58 | do { |
59 | 59 | curl_multi_exec($curl, $running); |
60 | - } while($running > 0); |
|
60 | + } while ($running>0); |
|
61 | 61 | |
62 | 62 | $responses = array(); |
63 | - foreach($handles as $k => $h) { |
|
63 | + foreach ($handles as $k => $h) { |
|
64 | 64 | $responses[$k] = curl_multi_getcontent($handles[$k]); |
65 | 65 | |
66 | - if ($this->debug > 1) { |
|
66 | + if ($this->debug>1) { |
|
67 | 67 | $message = "---CURL INFO---\n"; |
68 | 68 | foreach (curl_getinfo($h) as $name => $val) { |
69 | 69 | if (is_array($val)) { |
70 | 70 | $val = implode("\n", $val); |
71 | 71 | } |
72 | - $message .= $name . ': ' . $val . "\n"; |
|
72 | + $message .= $name.': '.$val."\n"; |
|
73 | 73 | } |
74 | 74 | $message .= '---END---'; |
75 | 75 | $this->getLogger()->debugMessage($message); |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | } |
81 | 81 | curl_multi_close($curl); |
82 | 82 | |
83 | - foreach($responses as $k => $resp) { |
|
83 | + foreach ($responses as $k => $resp) { |
|
84 | 84 | if (!$resp) { |
85 | - $responses[$k] = new Response(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'] . ': ' . curl_error($curl)); |
|
85 | + $responses[$k] = new Response(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'].': '.curl_error($curl)); |
|
86 | 86 | } else { |
87 | 87 | $responses[$k] = $requests[$k]->parseResponse($resp, true, $this->return_type); |
88 | 88 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $value = $encoder->encode($data, array('auto_dates')); |
100 | 100 | $req = new Request('interopEchoTests.echoValue', array($value)); |
101 | 101 | $reqs = array(); |
102 | -for ($i = 0; $i < $num_tests; $i++) { |
|
102 | +for ($i = 0; $i<$num_tests; $i++) { |
|
103 | 103 | $reqs[] = $req; |
104 | 104 | } |
105 | 105 | |
@@ -114,18 +114,18 @@ discard block |
||
114 | 114 | |
115 | 115 | $t = microtime(true); |
116 | 116 | $resp = $client->send($reqs); |
117 | -$t = microtime(true) - $t; |
|
118 | -echo "Sequential send: " . sprintf('%.3f', $t) . " secs.\n"; |
|
117 | +$t = microtime(true)-$t; |
|
118 | +echo "Sequential send: ".sprintf('%.3f', $t)." secs.\n"; |
|
119 | 119 | flush(); |
120 | 120 | |
121 | 121 | $t = microtime(true); |
122 | 122 | $resp = $client->sendParallel($reqs); |
123 | -$t = microtime(true) - $t; |
|
124 | -echo "Parallel send: " . sprintf('%.3f', $t) . " secs.\n"; |
|
123 | +$t = microtime(true)-$t; |
|
124 | +echo "Parallel send: ".sprintf('%.3f', $t)." secs.\n"; |
|
125 | 125 | flush(); |
126 | 126 | |
127 | 127 | $client->no_multicall = false; |
128 | 128 | $t = microtime(true); |
129 | 129 | $resp = $client->send($reqs); |
130 | -$t = microtime(true) - $t; |
|
131 | -echo "Multicall send: " . sprintf('%.3f', $t) . " secs.\n"; |
|
130 | +$t = microtime(true)-$t; |
|
131 | +echo "Multicall send: ".sprintf('%.3f', $t)." secs.\n"; |
@@ -1,6 +1,6 @@ discard block |
||
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 |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | $this->args = argParser::getArgs(); |
14 | 14 | |
15 | 15 | // assumes HTTPURI to be in the form /tests/index.php?etc... |
16 | - $this->baseUrl = $this->args['HTTPSERVER'] . preg_replace('|\?.+|', '', $this->args['HTTPURI']); |
|
17 | - $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . preg_replace('|/tests/index\.php(\?.*)?|', '/tests/phpunit_coverage.php', $this->args['HTTPURI']); |
|
16 | + $this->baseUrl = $this->args['HTTPSERVER'].preg_replace('|\?.+|', '', $this->args['HTTPURI']); |
|
17 | + $this->coverageScriptUrl = 'http://'.$this->args['HTTPSERVER'].preg_replace('|/tests/index\.php(\?.*)?|', '/tests/phpunit_coverage.php', $this->args['HTTPURI']); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | public function testBenchmark() |
@@ -6,7 +6,7 @@ |
||
6 | 6 | * @license code licensed under the BSD License: see file license.txt |
7 | 7 | **/ |
8 | 8 | |
9 | -$coverageFile = realpath(__DIR__ . "/../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/phpunit_coverage.php"); |
|
9 | +$coverageFile = realpath(__DIR__."/../vendor/phpunit/phpunit-selenium/PHPUnit/Extensions/SeleniumCommon/phpunit_coverage.php"); |
|
10 | 10 | |
11 | 11 | // has to be the same value as used in index.php |
12 | 12 | $GLOBALS['PHPUNIT_COVERAGE_DATA_DIRECTORY'] = '/tmp/phpxmlrpc_coverage'; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__ . '/WebTestCase.php'; |
|
3 | +include_once __DIR__.'/WebTestCase.php'; |
|
4 | 4 | |
5 | 5 | class DebuggerTest extends PhpXmlRpc_WebTestCase |
6 | 6 | { |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | $this->args = argParser::getArgs(); |
10 | 10 | |
11 | 11 | // assumes HTTPURI to be in the form /tests/index.php?etc... |
12 | - $this->baseUrl = $this->args['HTTPSERVER'] . preg_replace('|\?.+|', '', $this->args['HTTPURI']); |
|
13 | - $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . preg_replace('|/tests/index\.php(\?.*)?|', '/tests/phpunit_coverage.php', $this->args['HTTPURI']); |
|
12 | + $this->baseUrl = $this->args['HTTPSERVER'].preg_replace('|\?.+|', '', $this->args['HTTPURI']); |
|
13 | + $this->coverageScriptUrl = 'http://'.$this->args['HTTPSERVER'].preg_replace('|/tests/index\.php(\?.*)?|', '/tests/phpunit_coverage.php', $this->args['HTTPURI']); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | public function testIndex() |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | // check for command line params (passed as env vars) vs. web page input params (passed as GET/POST) |
47 | 47 | // Note that the only usecase for web-page mode is when this is used by benchmark.php |
48 | 48 | if (!isset($_SERVER['REQUEST_METHOD'])) { |
49 | - foreach($_SERVER as $key => $val) { |
|
49 | + foreach ($_SERVER as $key => $val) { |
|
50 | 50 | if (array_key_exists($key, $args)) { |
51 | 51 | $$key = $val; |
52 | 52 | } |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | //} |
92 | 92 | } |
93 | 93 | if ($HTTPURI[0] != '/') { |
94 | - $HTTPURI = '/' . $HTTPURI; |
|
94 | + $HTTPURI = '/'.$HTTPURI; |
|
95 | 95 | } |
96 | 96 | $args['HTTPURI'] = $HTTPURI; |
97 | 97 | |
@@ -105,21 +105,21 @@ discard block |
||
105 | 105 | } |
106 | 106 | |
107 | 107 | if (isset($HTTPSIGNOREPEER)) { |
108 | - $args['HTTPSIGNOREPEER'] = (bool)$HTTPSIGNOREPEER; |
|
108 | + $args['HTTPSIGNOREPEER'] = (bool) $HTTPSIGNOREPEER; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | if (isset($HTTPSVERIFYHOST)) { |
112 | - $args['HTTPSVERIFYHOST'] = (int)$HTTPSVERIFYHOST; |
|
112 | + $args['HTTPSVERIFYHOST'] = (int) $HTTPSVERIFYHOST; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | if (isset($SSLVERSION)) { |
116 | - $args['SSLVERSION'] = (int)$SSLVERSION; |
|
116 | + $args['SSLVERSION'] = (int) $SSLVERSION; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | if (isset($PROXYSERVER)) { |
120 | 120 | $arr = explode(':', $PROXYSERVER); |
121 | 121 | $args['PROXYSERVER'] = $arr[0]; |
122 | - if (count($arr) > 1) { |
|
122 | + if (count($arr)>1) { |
|
123 | 123 | $args['PROXYPORT'] = $arr[1]; |
124 | 124 | } else { |
125 | 125 | $args['PROXYPORT'] = 8080; |
@@ -1,11 +1,11 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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,7 +106,7 @@ discard block |
||
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 | if ($this->args['DEBUG'] == 1) |
112 | 112 | ob_start(); |
@@ -143,9 +143,9 @@ discard block |
||
143 | 143 | } |
144 | 144 | $this->validateResponse($r); |
145 | 145 | if (is_array($errorCode)) { |
146 | - $this->assertContains($r->faultCode(), $errorCode, 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); |
|
146 | + $this->assertContains($r->faultCode(), $errorCode, 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); |
|
147 | 147 | } else { |
148 | - $this->assertEquals($errorCode, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); |
|
148 | + $this->assertEquals($errorCode, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); |
|
149 | 149 | } |
150 | 150 | if (!$r->faultCode()) { |
151 | 151 | if ($returnResponse) { |
@@ -172,20 +172,20 @@ discard block |
||
172 | 172 | $query = parse_url($this->client->path, PHP_URL_QUERY); |
173 | 173 | parse_str($query, $vars); |
174 | 174 | $query = http_build_query(array_merge($vars, $data)); |
175 | - $this->client->path = parse_url($this->client->path, PHP_URL_PATH) . '?' . $query; |
|
175 | + $this->client->path = parse_url($this->client->path, PHP_URL_PATH).'?'.$query; |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | public function testString() |
179 | 179 | { |
180 | - $sendString = "here are 3 \"entities\": < > & " . |
|
181 | - "and here's a dollar sign: \$pretendvarname and a backslash too: " . chr(92) . |
|
182 | - " - isn't that great? \\\"hackery\\\" at it's best " . |
|
183 | - " also don't want to miss out on \$item[0]. " . |
|
184 | - "The real weird stuff follows: CRLF here" . chr(13) . chr(10) . |
|
185 | - "a simple CR here" . chr(13) . |
|
186 | - "a simple LF here" . chr(10) . |
|
187 | - "and then LFCR" . chr(10) . chr(13) . |
|
188 | - "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne, and an xml comment closing tag: -->"; |
|
180 | + $sendString = "here are 3 \"entities\": < > & ". |
|
181 | + "and here's a dollar sign: \$pretendvarname and a backslash too: ".chr(92). |
|
182 | + " - isn't that great? \\\"hackery\\\" at it's best ". |
|
183 | + " also don't want to miss out on \$item[0]. ". |
|
184 | + "The real weird stuff follows: CRLF here".chr(13).chr(10). |
|
185 | + "a simple CR here".chr(13). |
|
186 | + "a simple LF here".chr(10). |
|
187 | + "and then LFCR".chr(10).chr(13). |
|
188 | + "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne, and an xml comment closing tag: -->"; |
|
189 | 189 | $m = new xmlrpcmsg('examples.stringecho', array( |
190 | 190 | new xmlrpcval($sendString, 'string'), |
191 | 191 | )); |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | public function testLatin1String() |
207 | 207 | { |
208 | 208 | $sendString = |
209 | - "last but not least weird names: G" . chr(252) . "nter, El" . chr(232) . "ne"; |
|
209 | + "last but not least weird names: G".chr(252)."nter, El".chr(232)."ne"; |
|
210 | 210 | $x = '<?xml version="1.0" encoding="ISO-8859-1"?><methodCall><methodName>examples.stringecho</methodName><params><param><value>'. |
211 | 211 | $sendString. |
212 | 212 | '</value></param></params></methodCall>'; |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | public function testUtf8Method() |
316 | 316 | { |
317 | 317 | PhpXmlRpc\PhpXmlRpc::$xmlrpc_internalencoding = 'UTF-8'; |
318 | - $m = new xmlrpcmsg("tests.utf8methodname." . 'κόσμε', array( |
|
318 | + $m = new xmlrpcmsg("tests.utf8methodname.".'κόσμε', array( |
|
319 | 319 | new xmlrpcval('hello') |
320 | 320 | )); |
321 | 321 | $v = $this->send($m); |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | )); |
338 | 338 | $v = $this->send($m); |
339 | 339 | if ($v) { |
340 | - $this->assertEquals($a + $b, $v->scalarval()); |
|
340 | + $this->assertEquals($a+$b, $v->scalarval()); |
|
341 | 341 | } |
342 | 342 | } |
343 | 343 | |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | )); |
350 | 350 | $v = $this->send($m); |
351 | 351 | if ($v) { |
352 | - $this->assertEquals(12 - 23, $v->scalarval()); |
|
352 | + $this->assertEquals(12-23, $v->scalarval()); |
|
353 | 353 | } |
354 | 354 | } |
355 | 355 | |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | if ($v) { |
384 | 384 | $sz = $v->arraysize(); |
385 | 385 | $got = ''; |
386 | - for ($i = 0; $i < $sz; $i++) { |
|
386 | + for ($i = 0; $i<$sz; $i++) { |
|
387 | 387 | $b = $v->arraymem($i); |
388 | 388 | if ($b->scalarval()) { |
389 | 389 | $got .= '1'; |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | $got = ''; |
447 | 447 | $expected = '37210'; |
448 | 448 | $expect_array = array('ctLeftAngleBrackets', 'ctRightAngleBrackets', 'ctAmpersands', 'ctApostrophes', 'ctQuotes'); |
449 | - foreach($expect_array as $val) { |
|
449 | + foreach ($expect_array as $val) { |
|
450 | 450 | $b = $v->structmem($val); |
451 | 451 | $got .= $b->me['int']; |
452 | 452 | } |
@@ -899,7 +899,7 @@ discard block |
||
899 | 899 | { |
900 | 900 | // make a 'deep client copy' as the original one might have many properties set |
901 | 901 | // also for speed only wrap one method of the whole server |
902 | - $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/' )); |
|
902 | + $class = wrap_xmlrpc_server($this->client, array('simple_client_copy' => 0, 'method_filter' => '/examples\.getStateName/')); |
|
903 | 903 | if ($class == '') { |
904 | 904 | $this->fail('Registration of remote server failed'); |
905 | 905 | } else { |
@@ -938,9 +938,9 @@ discard block |
||
938 | 938 | $cookies = array( |
939 | 939 | //'c1' => array(), |
940 | 940 | 'c2' => array('value' => 'c2'), |
941 | - 'c3' => array('value' => 'c3', 'expires' => time() + 60 * 60 * 24 * 30), |
|
942 | - 'c4' => array('value' => 'c4', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/'), |
|
943 | - 'c5' => array('value' => 'c5', 'expires' => time() + 60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'), |
|
941 | + 'c3' => array('value' => 'c3', 'expires' => time()+60 * 60 * 24 * 30), |
|
942 | + 'c4' => array('value' => 'c4', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/'), |
|
943 | + 'c5' => array('value' => 'c5', 'expires' => time()+60 * 60 * 24 * 30, 'path' => '/', 'domain' => 'localhost'), |
|
944 | 944 | ); |
945 | 945 | $cookiesval = php_xmlrpc_encode($cookies); |
946 | 946 | $m = new xmlrpcmsg('tests.setcookies', array($cookiesval)); |
@@ -988,10 +988,10 @@ discard block |
||
988 | 988 | $m = new xmlrpcmsg('tests.getcookies', array()); |
989 | 989 | foreach ($cookies as $cookie => $val) { |
990 | 990 | $this->client->setCookie($cookie, $val); |
991 | - $cookies[$cookie] = (string)$cookies[$cookie]; |
|
991 | + $cookies[$cookie] = (string) $cookies[$cookie]; |
|
992 | 992 | } |
993 | 993 | $r = $this->client->send($m, $this->timeout, $this->method); |
994 | - $this->assertEquals(0, $r->faultCode(), 'Error ' . $r->faultCode() . ' connecting to server: ' . $r->faultString()); |
|
994 | + $this->assertEquals(0, $r->faultCode(), 'Error '.$r->faultCode().' connecting to server: '.$r->faultString()); |
|
995 | 995 | if (!$r->faultCode()) { |
996 | 996 | $v = $r->value(); |
997 | 997 | $v = php_xmlrpc_decode($v); |
@@ -108,14 +108,16 @@ |
||
108 | 108 | |
109 | 109 | $this->coverageScriptUrl = 'http://' . $this->args['HTTPSERVER'] . preg_replace('|/tests/index\.php(\?.*)?|', '/tests/phpunit_coverage.php', $this->args['HTTPURI']); |
110 | 110 | |
111 | - if ($this->args['DEBUG'] == 1) |
|
112 | - ob_start(); |
|
111 | + if ($this->args['DEBUG'] == 1) { |
|
112 | + ob_start(); |
|
113 | + } |
|
113 | 114 | } |
114 | 115 | |
115 | 116 | protected function tear_down() |
116 | 117 | { |
117 | - if ($this->args['DEBUG'] != 1) |
|
118 | - return; |
|
118 | + if ($this->args['DEBUG'] != 1) { |
|
119 | + return; |
|
120 | + } |
|
119 | 121 | $out = ob_get_clean(); |
120 | 122 | $status = $this->getStatus(); |
121 | 123 | if ($status == BaseTestRunner::STATUS_ERROR |
@@ -66,11 +66,12 @@ |
||
66 | 66 | $a = $req->getParam(0); |
67 | 67 | $b = $req->getParam(1); |
68 | 68 | |
69 | - if ($a->scalartyp() == Value::$xmlrpcNull) |
|
70 | - return new Response(new Value(plain_findstate($b->scalarval()))); |
|
71 | - else |
|
72 | - return new Response(new Value(plain_findstate($a->scalarval()))); |
|
73 | -} |
|
69 | + if ($a->scalartyp() == Value::$xmlrpcNull) { |
|
70 | + return new Response(new Value(plain_findstate($b->scalarval()))); |
|
71 | + } else { |
|
72 | + return new Response(new Value(plain_findstate($a->scalarval()))); |
|
73 | + } |
|
74 | + } |
|
74 | 75 | |
75 | 76 | return array( |
76 | 77 | "tests.getallheaders" => array( |
@@ -91,7 +91,7 @@ |
||
91 | 91 | |
92 | 92 | // Greek word 'kosme'. NB: NOT a valid ISO8859 string! |
93 | 93 | // NB: we can only register this when setting internal encoding to UTF-8, or it will break system.listMethods |
94 | - "tests.utf8methodname." . 'κόσμε' => array( |
|
94 | + "tests.utf8methodname.".'κόσμε' => array( |
|
95 | 95 | "function" => "exampleMethods::stringEcho", |
96 | 96 | "signature" => exampleMethods::$stringecho_sig, |
97 | 97 | "docstring" => exampleMethods::$stringecho_doc, |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -require_once __DIR__ . "/client/_prepend.php"; |
|
2 | +require_once __DIR__."/client/_prepend.php"; |
|
3 | 3 | |
4 | 4 | output('<html lang="en"> |
5 | 5 | <head><title>phpxmlrpc</title></head> |
@@ -10,23 +10,23 @@ discard block |
||
10 | 10 | output("<p>Please note that in most cases you are better off using `new PhpXmlRpc\Encoder()->encode()` to create nested Value objects</p>\n"); |
11 | 11 | |
12 | 12 | $v = new PhpXmlRpc\Value(1234, 'int'); |
13 | -output("Int: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
13 | +output("Int: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
14 | 14 | |
15 | 15 | $v = new PhpXmlRpc\Value('Are the following characters escaped? < & >'); |
16 | -output("String <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
16 | +output("String <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
17 | 17 | |
18 | 18 | $v = new PhpXmlRpc\Value(true, 'boolean'); |
19 | -output("Boolean: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
19 | +output("Boolean: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
20 | 20 | |
21 | 21 | $v = new PhpXmlRpc\Value(1234.5678, 'double'); |
22 | -output("Double: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
22 | +output("Double: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
23 | 23 | |
24 | 24 | $v = new PhpXmlRpc\Value(time(), 'dateTime.iso8601'); |
25 | -output("Datetime: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
25 | +output("Datetime: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
26 | 26 | |
27 | 27 | $v = new PhpXmlRpc\Value('hello world', 'base64'); |
28 | -output("Base64: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
29 | -output("(value of base64 string is: '" . $v->scalarval() . "')<BR><BR>"); |
|
28 | +output("Base64: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
29 | +output("(value of base64 string is: '".$v->scalarval()."')<BR><BR>"); |
|
30 | 30 | |
31 | 31 | $v = new PhpXmlRpc\Value( |
32 | 32 | array( |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | ), |
40 | 40 | "array" |
41 | 41 | ); |
42 | -output("Array: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
42 | +output("Array: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
43 | 43 | |
44 | 44 | $v = new PhpXmlRpc\Value( |
45 | 45 | array( |
@@ -59,10 +59,10 @@ discard block |
||
59 | 59 | ), |
60 | 60 | "struct" |
61 | 61 | ); |
62 | -output("Struct: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
62 | +output("Struct: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
63 | 63 | |
64 | 64 | $w = new PhpXmlRpc\Value(array($v), 'array'); |
65 | -output("Array containing a struct: <PRE>" . htmlentities($w->serialize()) . "</PRE>"); |
|
65 | +output("Array containing a struct: <PRE>".htmlentities($w->serialize())."</PRE>"); |
|
66 | 66 | |
67 | 67 | class MyClass |
68 | 68 | { |
@@ -74,46 +74,46 @@ discard block |
||
74 | 74 | // the public property is the only one which will be serialized. As such, it has to be of type Value |
75 | 75 | $myObject->public = new \PhpXmlRpc\Value('a public property, wrapped'); |
76 | 76 | $w = new PhpXmlRpc\Value($myObject, 'struct'); |
77 | -output("Struct encoding a php object: <PRE>" . htmlentities($w->serialize()) . "</PRE>"); |
|
77 | +output("Struct encoding a php object: <PRE>".htmlentities($w->serialize())."</PRE>"); |
|
78 | 78 | |
79 | 79 | output("<h3>Testing value serialization - xml-rpc extensions</h3>\n"); |
80 | 80 | $v = new PhpXmlRpc\Value(1234, 'i8'); |
81 | -output("I8: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
81 | +output("I8: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
82 | 82 | $v = new PhpXmlRpc\Value(null, 'null'); |
83 | -output("Null: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
83 | +output("Null: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
84 | 84 | \PhpXmlRpc\PhpXmlRpc::$xmlrpc_null_apache_encoding = true; |
85 | -output("Null, alternative: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
85 | +output("Null, alternative: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
86 | 86 | |
87 | 87 | output("<h3>Testing value serialization - character encoding</h3>\n"); |
88 | 88 | // The greek word 'kosme' |
89 | 89 | $v = new PhpXmlRpc\Value('κόσμε'); |
90 | -output("Greek (default encoding): <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
91 | -output("Greek (utf8 encoding): <PRE>" . htmlentities($v->serialize('UTF-8')) . "</PRE>"); |
|
90 | +output("Greek (default encoding): <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
91 | +output("Greek (utf8 encoding): <PRE>".htmlentities($v->serialize('UTF-8'))."</PRE>"); |
|
92 | 92 | |
93 | 93 | output("<h3>Testing request serialization</h3>\n"); |
94 | 94 | $req = new PhpXmlRpc\Request('examples.getStateName'); |
95 | 95 | $req->method('examples.getStateName'); |
96 | 96 | $req->addParam(new PhpXmlRpc\Value(42, 'int')); |
97 | -output("<PRE>" . htmlentities($req->serialize()) . "</PRE>"); |
|
97 | +output("<PRE>".htmlentities($req->serialize())."</PRE>"); |
|
98 | 98 | |
99 | 99 | output("<h3>Testing response serialization</h3>\n"); |
100 | 100 | $resp = new PhpXmlRpc\Response(new PhpXmlRpc\Value('The meaning of life')); |
101 | -output("<PRE>" . htmlentities($resp->serialize()) . "</PRE>"); |
|
101 | +output("<PRE>".htmlentities($resp->serialize())."</PRE>"); |
|
102 | 102 | |
103 | 103 | output("<h3>Testing ISO date formatting</h3><pre>\n"); |
104 | 104 | $t = time(); |
105 | 105 | $date = PhpXmlRpc\Helper\Date::iso8601Encode($t); |
106 | 106 | output("Now is $t --> $date\n"); |
107 | -output("Or in UTC, that is " . PhpXmlRpc\Helper\Date::iso8601Encode($t, 1) . "\n"); |
|
107 | +output("Or in UTC, that is ".PhpXmlRpc\Helper\Date::iso8601Encode($t, 1)."\n"); |
|
108 | 108 | $tb = PhpXmlRpc\Helper\Date::iso8601Decode($date); |
109 | 109 | output("That is to say $date --> $tb\n"); |
110 | -output("Which comes out at " . PhpXmlRpc\Helper\Date::iso8601Encode($tb) . "\n"); |
|
111 | -output("Which was the time in UTC at " . PhpXmlRpc\Helper\Date::iso8601Encode($tb, 1) . "\n"); |
|
110 | +output("Which comes out at ".PhpXmlRpc\Helper\Date::iso8601Encode($tb)."\n"); |
|
111 | +output("Which was the time in UTC at ".PhpXmlRpc\Helper\Date::iso8601Encode($tb, 1)."\n"); |
|
112 | 112 | output("</pre>\n"); |
113 | 113 | |
114 | 114 | output("<h3>Testing reduced-precision formatting for doubles</h3><pre>\n"); |
115 | 115 | $v = new PhpXmlRpc\Value(1234.56789, 'double'); |
116 | 116 | \PhpXmlRpc\PhpXmlRpc::$xmlpc_double_precision = 2; |
117 | -output("Double, limited precision: <PRE>" . htmlentities($v->serialize()) . "</PRE>"); |
|
117 | +output("Double, limited precision: <PRE>".htmlentities($v->serialize())."</PRE>"); |
|
118 | 118 | |
119 | 119 | output('</body></html>'); |