Passed
Push — master ( b73d50...e8d99c )
by Gaetano
07:04
created
demo/client/windowscharset.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 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 the charset conversion of the library: create a client class which uses data in the CP-1252 character set,
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.
tests/05LoggerTest.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.
tests/12ExtraFilesTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 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.
Please login to merge, or discard this patch.
tests/10DemofilesTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 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.
Please login to merge, or discard this patch.
tests/11DebuggerTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 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 the bundled debugger.
Please login to merge, or discard this patch.
tests/01CharsetTest.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
demo/client/wrap.php 1 patch
Spacing   +4 added lines, -4 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
 output('<html lang="en">
5 5
 <head><title>phpxmlrpc - Webservice wrapper demo</title></head>
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
src/Helper/Charset.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -76,14 +76,14 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.