@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | * @author JoakimLofgren |
4 | 4 | */ |
5 | 5 | |
6 | -include_once __DIR__ . '/PolyfillTestCase.php'; |
|
6 | +include_once __DIR__.'/PolyfillTestCase.php'; |
|
7 | 7 | |
8 | 8 | use PhpXmlRpc\Helper\Charset; |
9 | 9 | |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | public function testUtf8ToLatin1All() |
49 | 49 | { |
50 | 50 | $latinString = "\n\r\t"; |
51 | - for($i = 32; $i < 127; $i++) { |
|
51 | + for ($i = 32; $i<127; $i++) { |
|
52 | 52 | $latinString .= chr($i); |
53 | 53 | } |
54 | - for($i = 160; $i < 256; $i++) { |
|
54 | + for ($i = 160; $i<256; $i++) { |
|
55 | 55 | $latinString .= chr($i); |
56 | 56 | } |
57 | 57 |
@@ -26,12 +26,12 @@ discard block |
||
26 | 26 | |
27 | 27 | // read chunk-size, chunk-extension (if any) and crlf |
28 | 28 | // get the position of the linebreak |
29 | - $chunkEnd = strpos($buffer, "\r\n") + 2; |
|
29 | + $chunkEnd = strpos($buffer, "\r\n")+2; |
|
30 | 30 | $temp = substr($buffer, 0, $chunkEnd); |
31 | 31 | $chunkSize = hexdec(trim($temp)); |
32 | 32 | $chunkStart = $chunkEnd; |
33 | - while ($chunkSize > 0) { |
|
34 | - $chunkEnd = strpos($buffer, "\r\n", $chunkStart + $chunkSize); |
|
33 | + while ($chunkSize>0) { |
|
34 | + $chunkEnd = strpos($buffer, "\r\n", $chunkStart+$chunkSize); |
|
35 | 35 | |
36 | 36 | // just in case we got a broken connection |
37 | 37 | if ($chunkEnd == false) { |
@@ -43,19 +43,19 @@ discard block |
||
43 | 43 | } |
44 | 44 | |
45 | 45 | // read chunk-data and crlf |
46 | - $chunk = substr($buffer, $chunkStart, $chunkEnd - $chunkStart); |
|
46 | + $chunk = substr($buffer, $chunkStart, $chunkEnd-$chunkStart); |
|
47 | 47 | // append chunk-data to entity-body |
48 | 48 | $new .= $chunk; |
49 | 49 | // length := length + chunk-size |
50 | 50 | $length += strlen($chunk); |
51 | 51 | // read chunk-size and crlf |
52 | - $chunkStart = $chunkEnd + 2; |
|
52 | + $chunkStart = $chunkEnd+2; |
|
53 | 53 | |
54 | - $chunkEnd = strpos($buffer, "\r\n", $chunkStart) + 2; |
|
54 | + $chunkEnd = strpos($buffer, "\r\n", $chunkStart)+2; |
|
55 | 55 | if ($chunkEnd == false) { |
56 | 56 | break; // just in case we got a broken connection |
57 | 57 | } |
58 | - $temp = substr($buffer, $chunkStart, $chunkEnd - $chunkStart); |
|
58 | + $temp = substr($buffer, $chunkStart, $chunkEnd-$chunkStart); |
|
59 | 59 | $chunkSize = hexdec(trim($temp)); |
60 | 60 | $chunkStart = $chunkEnd; |
61 | 61 | } |
@@ -84,11 +84,11 @@ discard block |
||
84 | 84 | // Look for CR/LF or simple LF as line separator (even though it is not valid http) |
85 | 85 | $pos = strpos($data, "\r\n\r\n"); |
86 | 86 | if ($pos || is_int($pos)) { |
87 | - $bd = $pos + 4; |
|
87 | + $bd = $pos+4; |
|
88 | 88 | } else { |
89 | 89 | $pos = strpos($data, "\n\n"); |
90 | 90 | if ($pos || is_int($pos)) { |
91 | - $bd = $pos + 2; |
|
91 | + $bd = $pos+2; |
|
92 | 92 | } else { |
93 | 93 | // No separation between response headers and body: fault? |
94 | 94 | $bd = 0; |
@@ -98,8 +98,8 @@ discard block |
||
98 | 98 | // this filters out all http headers from proxy. maybe we could take them into account, too? |
99 | 99 | $data = substr($data, $bd); |
100 | 100 | } else { |
101 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': HTTPS via proxy error, tunnel connection possibly failed'); |
|
102 | - throw new HttpException(PhpXmlRpc::$xmlrpcstr['http_error'] . ' (HTTPS via proxy error, tunnel connection possibly failed)', PhpXmlRpc::$xmlrpcerr['http_error']); |
|
101 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': HTTPS via proxy error, tunnel connection possibly failed'); |
|
102 | + throw new HttpException(PhpXmlRpc::$xmlrpcstr['http_error'].' (HTTPS via proxy error, tunnel connection possibly failed)', PhpXmlRpc::$xmlrpcerr['http_error']); |
|
103 | 103 | } |
104 | 104 | } |
105 | 105 | |
@@ -132,19 +132,19 @@ discard block |
||
132 | 132 | } |
133 | 133 | |
134 | 134 | if ($httpResponse['status_code'] !== '200') { |
135 | - $errstr = substr($data, 0, strpos($data, "\n") - 1); |
|
136 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': HTTP error, got response: ' . $errstr); |
|
137 | - throw new HttpException(PhpXmlRpc::$xmlrpcstr['http_error'] . ' (' . $errstr . ')', PhpXmlRpc::$xmlrpcerr['http_error'], null, $httpResponse['status_code']); |
|
135 | + $errstr = substr($data, 0, strpos($data, "\n")-1); |
|
136 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': HTTP error, got response: '.$errstr); |
|
137 | + throw new HttpException(PhpXmlRpc::$xmlrpcstr['http_error'].' ('.$errstr.')', PhpXmlRpc::$xmlrpcerr['http_error'], null, $httpResponse['status_code']); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | // be tolerant to usage of \n instead of \r\n to separate headers and data (even though it is not valid http) |
141 | 141 | $pos = strpos($data, "\r\n\r\n"); |
142 | 142 | if ($pos || is_int($pos)) { |
143 | - $bd = $pos + 4; |
|
143 | + $bd = $pos+4; |
|
144 | 144 | } else { |
145 | 145 | $pos = strpos($data, "\n\n"); |
146 | 146 | if ($pos || is_int($pos)) { |
147 | - $bd = $pos + 2; |
|
147 | + $bd = $pos+2; |
|
148 | 148 | } else { |
149 | 149 | // No separation between response headers and body: fault? |
150 | 150 | // we could take some action here instead of going on... |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | foreach ($ar as $line) { |
159 | 159 | // take care of (multi-line) headers and cookies |
160 | 160 | $arr = explode(':', $line, 2); |
161 | - if (count($arr) > 1) { |
|
161 | + if (count($arr)>1) { |
|
162 | 162 | /// @todo according to https://www.rfc-editor.org/rfc/rfc7230#section-3.2.4, we should reject with error |
163 | 163 | /// 400 any messages where a space is present between the header name and colon |
164 | 164 | $headerName = strtolower(trim($arr[0])); |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | $cookie = $arr[1]; |
167 | 167 | // glue together all received cookies, using a comma to separate them (same as php does with getallheaders()) |
168 | 168 | if (isset($httpResponse['headers'][$headerName])) { |
169 | - $httpResponse['headers'][$headerName] .= ', ' . trim($cookie); |
|
169 | + $httpResponse['headers'][$headerName] .= ', '.trim($cookie); |
|
170 | 170 | } else { |
171 | 171 | $httpResponse['headers'][$headerName] = trim($cookie); |
172 | 172 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | } elseif (isset($headerName)) { |
198 | 198 | /// @todo improve this: 1. check that the line starts with a space or tab; 2. according to |
199 | 199 | /// https://www.rfc-editor.org/rfc/rfc7230#section-3.2.4, we should flat out refuse these messages |
200 | - $httpResponse['headers'][$headerName] .= ' ' . trim($line); |
|
200 | + $httpResponse['headers'][$headerName] .= ' '.trim($line); |
|
201 | 201 | } |
202 | 202 | } |
203 | 203 | |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | // Decode chunked encoding sent by http 1.1 servers |
221 | 221 | if (isset($httpResponse['headers']['transfer-encoding']) && $httpResponse['headers']['transfer-encoding'] == 'chunked') { |
222 | 222 | if (!$data = static::decodeChunked($data)) { |
223 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': errors occurred when trying to rebuild the chunked data received from server'); |
|
223 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': errors occurred when trying to rebuild the chunked data received from server'); |
|
224 | 224 | throw new HttpException(PhpXmlRpc::$xmlrpcstr['dechunk_fail'], PhpXmlRpc::$xmlrpcerr['dechunk_fail'], null, $httpResponse['status_code']); |
225 | 225 | } |
226 | 226 | } |
@@ -235,19 +235,19 @@ discard block |
||
235 | 235 | if ($httpResponse['headers']['content-encoding'] == 'deflate' && $degzdata = @gzuncompress($data)) { |
236 | 236 | $data = $degzdata; |
237 | 237 | if ($debug) { |
238 | - $this->getLogger()->debug("---INFLATED RESPONSE---[" . strlen($data) . " chars]---\n$data\n---END---"); |
|
238 | + $this->getLogger()->debug("---INFLATED RESPONSE---[".strlen($data)." chars]---\n$data\n---END---"); |
|
239 | 239 | } |
240 | 240 | } elseif ($httpResponse['headers']['content-encoding'] == 'gzip' && $degzdata = @gzinflate(substr($data, 10))) { |
241 | 241 | $data = $degzdata; |
242 | 242 | if ($debug) { |
243 | - $this->getLogger()->debug("---INFLATED RESPONSE---[" . strlen($data) . " chars]---\n$data\n---END---"); |
|
243 | + $this->getLogger()->debug("---INFLATED RESPONSE---[".strlen($data)." chars]---\n$data\n---END---"); |
|
244 | 244 | } |
245 | 245 | } else { |
246 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': errors occurred when trying to decode the deflated data received from server'); |
|
246 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': errors occurred when trying to decode the deflated data received from server'); |
|
247 | 247 | throw new HttpException(PhpXmlRpc::$xmlrpcstr['decompress_fail'], PhpXmlRpc::$xmlrpcerr['decompress_fail'], null, $httpResponse['status_code']); |
248 | 248 | } |
249 | 249 | } else { |
250 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': the server sent deflated data. Your php install must have the Zlib extension compiled in to support this.'); |
|
250 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': the server sent deflated data. Your php install must have the Zlib extension compiled in to support this.'); |
|
251 | 251 | throw new HttpException(PhpXmlRpc::$xmlrpcstr['cannot_decompress'], PhpXmlRpc::$xmlrpcerr['cannot_decompress'], null, $httpResponse['status_code']); |
252 | 252 | } |
253 | 253 | } |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | public function parseAcceptHeader($header) |
268 | 268 | { |
269 | 269 | $accepted = array(); |
270 | - foreach(explode(',', $header) as $c) { |
|
270 | + foreach (explode(',', $header) as $c) { |
|
271 | 271 | if (preg_match('/^([^;]+); *q=([0-9.]+)/', $c, $matches)) { |
272 | 272 | $c = $matches[1]; |
273 | 273 | $w = $matches[2]; |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__ . '/LoggerAwareTestCase.php'; |
|
3 | +include_once __DIR__.'/LoggerAwareTestCase.php'; |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Tests involving Requests and Responses, except for the parsing part |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__ . '/LoggerAwareTestCase.php'; |
|
3 | +include_once __DIR__.'/LoggerAwareTestCase.php'; |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Tests involving automatic encoding/decoding of php values into xmlrpc values (the Encoder class). |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | /// @todo it seems that old php versions can not automatically transform latin to utf8 upon xml parsing. |
76 | 76 | /// We should fix that, then re-enable this test |
77 | 77 | if (version_compare(PHP_VERSION, '5.6.0', '>=')) { |
78 | - $i = $e->decodeXml('<?xml version="1.0" encoding="ISO-8859-15" ?><value><string>' . $string . '</string></value>'); |
|
78 | + $i = $e->decodeXml('<?xml version="1.0" encoding="ISO-8859-15" ?><value><string>'.$string.'</string></value>'); |
|
79 | 79 | $this->assertEquals($string, $i->scalarVal()); |
80 | 80 | } |
81 | 81 |
@@ -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 | output('<html lang="en"> |
5 | 5 | <head><title>phpxmlrpc - Webservice wrapper demo</title></head> |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | $client->setOption(\PhpXmlRpc\Client::OPT_RETURN_TYPE, 'phpvals'); // let client give us back php values instead of xmlrpcvals |
21 | 21 | $resp = $client->send(new PhpXmlRpc\Request('system.listMethods')); |
22 | 22 | if ($resp->faultCode()) { |
23 | - output("<p>Server methods list could not be retrieved: error {$resp->faultCode()} '" . htmlspecialchars($resp->faultString()) . "'</p>\n"); |
|
23 | + output("<p>Server methods list could not be retrieved: error {$resp->faultCode()} '".htmlspecialchars($resp->faultString())."'</p>\n"); |
|
24 | 24 | } else { |
25 | 25 | output("<p>Server methods list retrieved, now wrapping it up...</p>\n<ul>\n"); |
26 | 26 | flush(); |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | if ($methodName == 'examples.getStateName') { |
33 | 33 | $callable = $wrapper->wrapXmlrpcMethod($client, $methodName); |
34 | 34 | if ($callable) { |
35 | - output("<li>Remote server method " . htmlspecialchars($methodName) . " wrapped into php function</li>\n"); |
|
35 | + output("<li>Remote server method ".htmlspecialchars($methodName)." wrapped into php function</li>\n"); |
|
36 | 36 | } else { |
37 | - output("<li>Remote server method " . htmlspecialchars($methodName) . " could not be wrapped!</li>\n"); |
|
37 | + output("<li>Remote server method ".htmlspecialchars($methodName)." could not be wrapped!</li>\n"); |
|
38 | 38 | } |
39 | 39 | break; |
40 | 40 | } |
@@ -76,14 +76,14 @@ discard block |
||
76 | 76 | if (count($this->xml_iso88591_Entities['in'])) { |
77 | 77 | return; |
78 | 78 | } |
79 | - for ($i = 0; $i < 32; $i++) { |
|
79 | + for ($i = 0; $i<32; $i++) { |
|
80 | 80 | $this->xml_iso88591_Entities["in"][] = chr($i); |
81 | 81 | $this->xml_iso88591_Entities["out"][] = "&#{$i};"; |
82 | 82 | } |
83 | 83 | |
84 | 84 | /// @todo to be 'print safe', should we encode as well character 127 (DEL) ? |
85 | 85 | |
86 | - for ($i = 160; $i < 256; $i++) { |
|
86 | + for ($i = 160; $i<256; $i++) { |
|
87 | 87 | $this->xml_iso88591_Entities["in"][] = chr($i); |
88 | 88 | $this->xml_iso88591_Entities["out"][] = "&#{$i};"; |
89 | 89 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | break;*/ |
112 | 112 | |
113 | 113 | default: |
114 | - throw new ValueErrorException('Unsupported table: ' . $tableName); |
|
114 | + throw new ValueErrorException('Unsupported table: '.$tableName); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $srcEncoding = 'UTF-8'; |
164 | 164 | } |
165 | 165 | |
166 | - $conversion = strtoupper($srcEncoding . '_' . $destEncoding); |
|
166 | + $conversion = strtoupper($srcEncoding.'_'.$destEncoding); |
|
167 | 167 | |
168 | 168 | // list ordered with (expected) most common scenarios first |
169 | 169 | switch ($conversion) { |
@@ -181,20 +181,20 @@ discard block |
||
181 | 181 | // NB: this will choke on invalid UTF-8, going most likely beyond EOF |
182 | 182 | $escapedData = ''; |
183 | 183 | // be kind to users creating string xml-rpc values out of different php types |
184 | - $data = (string)$data; |
|
184 | + $data = (string) $data; |
|
185 | 185 | $ns = strlen($data); |
186 | - for ($nn = 0; $nn < $ns; $nn++) { |
|
186 | + for ($nn = 0; $nn<$ns; $nn++) { |
|
187 | 187 | $ch = $data[$nn]; |
188 | 188 | $ii = ord($ch); |
189 | 189 | // 7 bits in 1 byte: 0bbbbbbb (127) |
190 | - if ($ii < 32) { |
|
190 | + if ($ii<32) { |
|
191 | 191 | if ($conversion == 'UTF-8_US-ASCII') { |
192 | 192 | $escapedData .= sprintf('&#%d;', $ii); |
193 | 193 | } else { |
194 | 194 | $escapedData .= $ch; |
195 | 195 | } |
196 | 196 | } |
197 | - else if ($ii < 128) { |
|
197 | + else if ($ii<128) { |
|
198 | 198 | /// @todo shall we replace this with a (supposedly) faster str_replace? |
199 | 199 | /// @todo to be 'print safe', should we encode as well character 127 (DEL) ? |
200 | 200 | switch ($ii) { |
@@ -219,25 +219,25 @@ discard block |
||
219 | 219 | } // 11 bits in 2 bytes: 110bbbbb 10bbbbbb (2047) |
220 | 220 | elseif ($ii >> 5 == 6) { |
221 | 221 | $b1 = ($ii & 31); |
222 | - $b2 = (ord($data[$nn + 1]) & 63); |
|
223 | - $ii = ($b1 * 64) + $b2; |
|
222 | + $b2 = (ord($data[$nn+1]) & 63); |
|
223 | + $ii = ($b1 * 64)+$b2; |
|
224 | 224 | $escapedData .= sprintf('&#%d;', $ii); |
225 | 225 | $nn += 1; |
226 | 226 | } // 16 bits in 3 bytes: 1110bbbb 10bbbbbb 10bbbbbb |
227 | 227 | elseif ($ii >> 4 == 14) { |
228 | 228 | $b1 = ($ii & 15); |
229 | - $b2 = (ord($data[$nn + 1]) & 63); |
|
230 | - $b3 = (ord($data[$nn + 2]) & 63); |
|
231 | - $ii = ((($b1 * 64) + $b2) * 64) + $b3; |
|
229 | + $b2 = (ord($data[$nn+1]) & 63); |
|
230 | + $b3 = (ord($data[$nn+2]) & 63); |
|
231 | + $ii = ((($b1 * 64)+$b2) * 64)+$b3; |
|
232 | 232 | $escapedData .= sprintf('&#%d;', $ii); |
233 | 233 | $nn += 2; |
234 | 234 | } // 21 bits in 4 bytes: 11110bbb 10bbbbbb 10bbbbbb 10bbbbbb |
235 | 235 | elseif ($ii >> 3 == 30) { |
236 | 236 | $b1 = ($ii & 7); |
237 | - $b2 = (ord($data[$nn + 1]) & 63); |
|
238 | - $b3 = (ord($data[$nn + 2]) & 63); |
|
239 | - $b4 = (ord($data[$nn + 3]) & 63); |
|
240 | - $ii = ((((($b1 * 64) + $b2) * 64) + $b3) * 64) + $b4; |
|
237 | + $b2 = (ord($data[$nn+1]) & 63); |
|
238 | + $b3 = (ord($data[$nn+2]) & 63); |
|
239 | + $b4 = (ord($data[$nn+3]) & 63); |
|
240 | + $ii = ((((($b1 * 64)+$b2) * 64)+$b3) * 64)+$b4; |
|
241 | 241 | $escapedData .= sprintf('&#%d;', $ii); |
242 | 242 | $nn += 3; |
243 | 243 | } |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | // If src is UTF8, we run htmlspecialchars before converting to the target charset, as |
291 | 291 | // htmlspecialchars has limited charset support, but it groks utf8 |
292 | 292 | if ($srcEncoding === 'UTF-8') { |
293 | - $data = htmlspecialchars($data, defined('ENT_XML1') ? ENT_XML1 | ENT_QUOTES : ENT_QUOTES, 'UTF-8'); |
|
293 | + $data = htmlspecialchars($data, defined('ENT_XML1') ? ENT_XML1 | ENT_QUOTES : ENT_QUOTES, 'UTF-8'); |
|
294 | 294 | } |
295 | 295 | if ($srcEncoding !== $destEncoding) { |
296 | 296 | try { |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | } |
303 | 303 | if ($data === false) { |
304 | 304 | $escapedData = ''; |
305 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ": Converting from $srcEncoding to $destEncoding via mbstring: failed..."); |
|
305 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.": Converting from $srcEncoding to $destEncoding via mbstring: failed..."); |
|
306 | 306 | } else { |
307 | 307 | if ($srcEncoding === 'UTF-8') { |
308 | 308 | $escapedData = $data; |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | } |
313 | 313 | } else { |
314 | 314 | $escapedData = ''; |
315 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ": Converting from $srcEncoding to $destEncoding: not supported..."); |
|
315 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.": Converting from $srcEncoding to $destEncoding: not supported..."); |
|
316 | 316 | } |
317 | 317 | } |
318 | 318 | |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | if (function_exists('mb_list_encodings')) { |
331 | 331 | $knownCharsets = array_unique(array_merge($knownCharsets, array_diff(mb_list_encodings(), array( |
332 | 332 | 'pass', 'auto', 'wchar', 'BASE64', 'UUENCODE', 'ASCII', 'HTML-ENTITIES', 'Quoted-Printable', |
333 | - '7bit','8bit', 'byte2be', 'byte2le', 'byte4be', 'byte4le' |
|
333 | + '7bit', '8bit', 'byte2be', 'byte2le', 'byte4be', 'byte4le' |
|
334 | 334 | )))); |
335 | 335 | } |
336 | 336 | return $knownCharsets; |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | */ |
348 | 348 | public function isValidCharset($encoding, $validList) |
349 | 349 | { |
350 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
350 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
351 | 351 | |
352 | 352 | if (is_string($validList)) { |
353 | 353 | $validList = explode(',', $validList); |
@@ -377,14 +377,14 @@ discard block |
||
377 | 377 | */ |
378 | 378 | public function getEntities($charset) |
379 | 379 | { |
380 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
380 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
381 | 381 | |
382 | 382 | switch ($charset) |
383 | 383 | { |
384 | 384 | case 'iso88591': |
385 | 385 | return $this->xml_iso88591_Entities; |
386 | 386 | default: |
387 | - throw new ValueErrorException('Unsupported charset: ' . $charset); |
|
387 | + throw new ValueErrorException('Unsupported charset: '.$charset); |
|
388 | 388 | } |
389 | 389 | } |
390 | 390 | } |
@@ -1,11 +1,11 @@ discard block |
||
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 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | protected function tear_down() |
34 | 34 | { |
35 | - if ($this->args['DEBUG'] > 0) { |
|
35 | + if ($this->args['DEBUG']>0) { |
|
36 | 36 | return; |
37 | 37 | } |
38 | 38 | |
@@ -50,16 +50,16 @@ discard block |
||
50 | 50 | |
51 | 51 | public function debug($message, $context = array()) |
52 | 52 | { |
53 | - $this->buffer .= $message . "\n"; |
|
53 | + $this->buffer .= $message."\n"; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | public function error($message, $context = array()) |
57 | 57 | { |
58 | - $this->buffer .= $message . "\n"; |
|
58 | + $this->buffer .= $message."\n"; |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | public function warning($message, $context = array()) |
62 | 62 | { |
63 | - $this->buffer .= $message . "\n"; |
|
63 | + $this->buffer .= $message."\n"; |
|
64 | 64 | } |
65 | 65 | } |
@@ -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 | /** |
5 | 5 | * Demoing how to inject a custom logger for use by the library |
@@ -21,17 +21,17 @@ discard block |
||
21 | 21 | // logger API |
22 | 22 | public function debug($message, $context = array()) |
23 | 23 | { |
24 | - $this->debugBuffer .= $message . "\n"; |
|
24 | + $this->debugBuffer .= $message."\n"; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | public function error($message, $context = array()) |
28 | 28 | { |
29 | - $this->errorBuffer .= $message . "\n"; |
|
29 | + $this->errorBuffer .= $message."\n"; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | public function warning($message, $context = array()) |
33 | 33 | { |
34 | - $this->warningBuffer .= $message . "\n"; |
|
34 | + $this->warningBuffer .= $message."\n"; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | public function getDebug() |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | |
63 | 63 | $input = array( |
64 | 64 | array('name' => 'Dave', 'age' => 24), |
65 | - array('name' => 'Edd', 'age' => 45), |
|
66 | - array('name' => 'Joe', 'age' => 37), |
|
65 | + array('name' => 'Edd', 'age' => 45), |
|
66 | + array('name' => 'Joe', 'age' => 37), |
|
67 | 67 | array('name' => 'Fred', 'age' => 27), |
68 | 68 | ); |
69 | 69 | |
@@ -85,6 +85,6 @@ discard block |
||
85 | 85 | $response = $client->send($request); |
86 | 86 | output("Response received.<br>"); |
87 | 87 | |
88 | -output("The client error info is:<pre>\n" . $logger->getError() . "\n</pre>"); |
|
89 | -output("The client warning info is:<pre>\n" . $logger->getWarning() . "\n</pre>"); |
|
90 | -output("The client debug info is:<pre>\n" . $logger->getDebug() . "\n</pre>"); |
|
88 | +output("The client error info is:<pre>\n".$logger->getError()."\n</pre>"); |
|
89 | +output("The client warning info is:<pre>\n".$logger->getWarning()."\n</pre>"); |
|
90 | +output("The client debug info is:<pre>\n".$logger->getDebug()."\n</pre>"); |
@@ -28,7 +28,7 @@ |
||
28 | 28 | if ($response->faultCode()) { |
29 | 29 | throw new HttpException(502, $response->faultString()); |
30 | 30 | } else { |
31 | - return new Response("<html><body>State number $stateNo is: " . $response->value()->scalarVal() . '</body></html>'); |
|
31 | + return new Response("<html><body>State number $stateNo is: ".$response->value()->scalarVal().'</body></html>'); |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 | } |