Passed
Push — master ( 8b6717...c8a221 )
by Gaetano
08:12
created
src/Encoder.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -57,13 +57,13 @@  discard block
 block discarded – undo
57 57
                                 'scalar' => $val,
58 58
                                 'timestamp' => \PhpXmlRpc\Helper\Date::iso8601Decode($val)
59 59
                             );
60
-                            return (object)$xmlrpcVal;
60
+                            return (object) $xmlrpcVal;
61 61
                         case 'base64':
62 62
                             $xmlrpcVal = array(
63 63
                                 'xmlrpc_type' => 'base64',
64 64
                                 'scalar' => $val
65 65
                             );
66
-                            return (object)$xmlrpcVal;
66
+                            return (object) $xmlrpcVal;
67 67
                         case 'string':
68 68
                             if (isset($options['extension_api_encoding'])) {
69 69
                                 // if iconv is not available, we use mb_convert_encoding
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
             case 'msg':
137 137
                 $paramCount = $xmlrpcVal->getNumParams();
138 138
                 $arr = array();
139
-                for ($i = 0; $i < $paramCount; $i++) {
139
+                for ($i = 0; $i<$paramCount; $i++) {
140 140
                     $arr[] = $this->decode($xmlrpcVal->getParam($i), $options);
141 141
                 }
142 142
                 return $arr;
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
                 break;
262 262
             case 'resource':
263 263
                 if (in_array('extension_api', $options)) {
264
-                    $xmlrpcVal = new Value((int)$phpVal, Value::$xmlrpcInt);
264
+                    $xmlrpcVal = new Value((int) $phpVal, Value::$xmlrpcInt);
265 265
                 } else {
266 266
                     $xmlrpcVal = new Value();
267 267
                 }
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
                     if ($valEncoding == 'ISO-8859-1') {
311 311
                         $xmlVal = utf8_encode($xmlVal);
312 312
                     } else {
313
-                        $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': invalid charset encoding of xml text: ' . $valEncoding);
313
+                        $this->getLogger()->error('XML-RPC: '.__METHOD__.': invalid charset encoding of xml text: '.$valEncoding);
314 314
                     }
315 315
                 }
316 316
             }
@@ -336,10 +336,10 @@  discard block
 block discarded – undo
336 336
             $_xh = $xmlRpcParser->_xh;
337 337
         }
338 338
 
339
-        if ($_xh['isf'] > 1) {
339
+        if ($_xh['isf']>1) {
340 340
             // test that $_xh['value'] is an obj, too???
341 341
 
342
-            $this->getLogger()->error('XML-RPC: ' . $_xh['isf_reason']);
342
+            $this->getLogger()->error('XML-RPC: '.$_xh['isf_reason']);
343 343
 
344 344
             return false;
345 345
         }
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
 
361 361
             case 'methodcall':
362 362
                 $req = new Request($_xh['method']);
363
-                for ($i = 0; $i < count($_xh['params']); $i++) {
363
+                for ($i = 0; $i<count($_xh['params']); $i++) {
364 364
                     $req->addParam($_xh['params'][$i]);
365 365
                 }
366 366
                 return $req;
Please login to merge, or discard this patch.
src/Server.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -463,7 +463,7 @@
 block discarded – undo
463 463
     public function addToMap($methodName, $function, $sig = null, $doc = false, $sigDoc = false, $parametersType = false,
464 464
         $exceptionHandling = false)
465 465
     {
466
-       $this->add_to_map($methodName, $function, $sig, $doc, $sigDoc, $parametersType, $exceptionHandling);
466
+        $this->add_to_map($methodName, $function, $sig, $doc, $sigDoc, $parametersType, $exceptionHandling);
467 467
     }
468 468
 
469 469
     /**
Please login to merge, or discard this patch.
Spacing   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
     public function getOptions()
252 252
     {
253 253
         $values = array();
254
-        foreach(static::$options as $opt) {
254
+        foreach (static::$options as $opt) {
255 255
             $values[$opt] = $this->getOption($opt);
256 256
         }
257 257
         return $values;
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
      */
265 265
     public function setOptions($options)
266 266
     {
267
-        foreach($options as $name => $value) {
267
+        foreach ($options as $name => $value) {
268 268
             $this->setOption($name, $value);
269 269
         }
270 270
 
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
      */
303 303
     public static function xmlrpc_debugmsg($msg)
304 304
     {
305
-        static::$_xmlrpc_debuginfo .= $msg . "\n";
305
+        static::$_xmlrpc_debuginfo .= $msg."\n";
306 306
     }
307 307
 
308 308
     /**
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
      */
315 315
     public static function error_occurred($msg)
316 316
     {
317
-        static::$_xmlrpcs_occurred_errors .= $msg . "\n";
317
+        static::$_xmlrpcs_occurred_errors .= $msg."\n";
318 318
     }
319 319
 
320 320
     /**
@@ -335,10 +335,10 @@  discard block
 block discarded – undo
335 335
         // user debug info should be encoded by the end user using the INTERNAL_ENCODING
336 336
         $out = '';
337 337
         if ($this->debug_info != '') {
338
-            $out .= "<!-- SERVER DEBUG INFO (BASE64 ENCODED):\n" . base64_encode($this->debug_info) . "\n-->\n";
338
+            $out .= "<!-- SERVER DEBUG INFO (BASE64 ENCODED):\n".base64_encode($this->debug_info)."\n-->\n";
339 339
         }
340 340
         if (static::$_xmlrpc_debuginfo != '') {
341
-            $out .= "<!-- DEBUG INFO:\n" . $this->getCharsetEncoder()->encodeEntities(str_replace('--', '_-', static::$_xmlrpc_debuginfo), PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding) . "\n-->\n";
341
+            $out .= "<!-- DEBUG INFO:\n".$this->getCharsetEncoder()->encodeEntities(str_replace('--', '_-', static::$_xmlrpc_debuginfo), PhpXmlRpc::$xmlrpc_internalencoding, $charsetEncoding)."\n-->\n";
342 342
             // NB: a better solution MIGHT be to use CDATA, but we need to insert it
343 343
             // into return payload AFTER the beginning tag
344 344
             //$out .= "<![CDATA[ DEBUG INFO:\n\n" . str_replace(']]>', ']_]_>', static::$_xmlrpc_debuginfo) . "\n]]>\n";
@@ -367,8 +367,8 @@  discard block
 block discarded – undo
367 367
         $this->debug_info = '';
368 368
 
369 369
         // Save what we received, before parsing it
370
-        if ($this->debug > 1) {
371
-            $this->debugMsg("+++GOT+++\n" . $data . "\n+++END+++");
370
+        if ($this->debug>1) {
371
+            $this->debugMsg("+++GOT+++\n".$data."\n+++END+++");
372 372
         }
373 373
 
374 374
         $resp = $this->parseRequestHeaders($data, $reqCharset, $respCharset, $respEncoding);
@@ -385,9 +385,9 @@  discard block
 block discarded – undo
385 385
             $resp->raw_data = $rawData;
386 386
         }
387 387
 
388
-        if ($this->debug > 2 && static::$_xmlrpcs_occurred_errors != '') {
389
-            $this->debugMsg("+++PROCESSING ERRORS AND WARNINGS+++\n" .
390
-                static::$_xmlrpcs_occurred_errors . "+++END+++");
388
+        if ($this->debug>2 && static::$_xmlrpcs_occurred_errors != '') {
389
+            $this->debugMsg("+++PROCESSING ERRORS AND WARNINGS+++\n".
390
+                static::$_xmlrpcs_occurred_errors."+++END+++");
391 391
         }
392 392
 
393 393
         $payload = $this->generatePayload($resp, $respCharset);
@@ -482,9 +482,9 @@  discard block
 block discarded – undo
482 482
             $numParams = count($in);
483 483
         }
484 484
         foreach ($sigs as $curSig) {
485
-            if (count($curSig) == $numParams + 1) {
485
+            if (count($curSig) == $numParams+1) {
486 486
                 $itsOK = 1;
487
-                for ($n = 0; $n < $numParams; $n++) {
487
+                for ($n = 0; $n<$numParams; $n++) {
488 488
                     if (is_object($in)) {
489 489
                         $p = $in->getParam($n);
490 490
                         if ($p->kindOf() == 'scalar') {
@@ -497,10 +497,10 @@  discard block
 block discarded – undo
497 497
                     }
498 498
 
499 499
                     // param index is $n+1, as first member of sig is return type
500
-                    if ($pt != $curSig[$n + 1] && $curSig[$n + 1] != Value::$xmlrpcValue) {
500
+                    if ($pt != $curSig[$n+1] && $curSig[$n+1] != Value::$xmlrpcValue) {
501 501
                         $itsOK = 0;
502
-                        $pno = $n + 1;
503
-                        $wanted = $curSig[$n + 1];
502
+                        $pno = $n+1;
503
+                        $wanted = $curSig[$n+1];
504 504
                         $got = $pt;
505 505
                         break;
506 506
                     }
@@ -527,10 +527,10 @@  discard block
 block discarded – undo
527 527
         // check if $_SERVER is populated: it might have been disabled via ini file
528 528
         // (this is true even when in CLI mode)
529 529
         if (count($_SERVER) == 0) {
530
-            $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': cannot parse request headers as $_SERVER is not populated');
530
+            $this->getLogger()->error('XML-RPC: '.__METHOD__.': cannot parse request headers as $_SERVER is not populated');
531 531
         }
532 532
 
533
-        if ($this->debug > 1) {
533
+        if ($this->debug>1) {
534 534
             if (function_exists('getallheaders')) {
535 535
                 $this->debugMsg(''); // empty line
536 536
                 foreach (getallheaders() as $name => $val) {
@@ -555,13 +555,13 @@  discard block
 block discarded – undo
555 555
                 if (function_exists('gzinflate') && in_array($contentEncoding, $this->accepted_compression)) {
556 556
                     if ($contentEncoding == 'deflate' && $degzdata = @gzuncompress($data)) {
557 557
                         $data = $degzdata;
558
-                        if ($this->debug > 1) {
559
-                            $this->debugMsg("\n+++INFLATED REQUEST+++[" . strlen($data) . " chars]+++\n" . $data . "\n+++END+++");
558
+                        if ($this->debug>1) {
559
+                            $this->debugMsg("\n+++INFLATED REQUEST+++[".strlen($data)." chars]+++\n".$data."\n+++END+++");
560 560
                         }
561 561
                     } elseif ($contentEncoding == 'gzip' && $degzdata = @gzinflate(substr($data, 10))) {
562 562
                         $data = $degzdata;
563
-                        if ($this->debug > 1) {
564
-                            $this->debugMsg("+++INFLATED REQUEST+++[" . strlen($data) . " chars]+++\n" . $data . "\n+++END+++");
563
+                        if ($this->debug>1) {
564
+                            $this->debugMsg("+++INFLATED REQUEST+++[".strlen($data)." chars]+++\n".$data."\n+++END+++");
565 565
                         }
566 566
                     } else {
567 567
                         $r = new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['server_decompress_fail'],
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
                     if ($reqEncoding == 'ISO-8859-1') {
650 650
                         $data = utf8_encode($data);
651 651
                     } else {
652
-                        $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': unsupported charset encoding of received request: ' . $reqEncoding);
652
+                        $this->getLogger()->error('XML-RPC: '.__METHOD__.': unsupported charset encoding of received request: '.$reqEncoding);
653 653
                     }
654 654
                 }
655 655
             }
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
             preg_match('/^XML error ([0-9]+)/', $_xh['isf_reason'], $matches);
685 685
             return new static::$responseClass(
686 686
                 0,
687
-                (PhpXmlRpc::isUsingInteropFaults() ? PhpXmlRpc::$xmlrpcerr['invalid_xml'] : PhpXmlRpc::$xmlrpcerrxml + (int)$matches[1]),
687
+                (PhpXmlRpc::isUsingInteropFaults() ? PhpXmlRpc::$xmlrpcerr['invalid_xml'] : PhpXmlRpc::$xmlrpcerrxml+(int) $matches[1]),
688 688
                 $_xh['isf_reason']);
689 689
         } elseif ($_xh['isf']) {
690 690
             /// @todo separate better the various cases, as we have done in Request::parseResponse: invalid xml-rpc vs.
@@ -692,7 +692,7 @@  discard block
 block discarded – undo
692 692
             return new static::$responseClass(
693 693
                 0,
694 694
                 PhpXmlRpc::$xmlrpcerr['invalid_request'],
695
-                PhpXmlRpc::$xmlrpcstr['invalid_request'] . ' ' . $_xh['isf_reason']);
695
+                PhpXmlRpc::$xmlrpcstr['invalid_request'].' '.$_xh['isf_reason']);
696 696
         } else {
697 697
             // small layering violation in favor of speed and memory usage: we should allow the 'execute' method handle
698 698
             // this, but in the most common scenario (xml-rpc values type server with some methods registered as phpvals)
@@ -702,8 +702,8 @@  discard block
 block discarded – undo
702 702
                     ($this->dmap[$_xh['method']]['parameters_type'] != 'xmlrpcvals')
703 703
                 )
704 704
             ) {
705
-                if ($this->debug > 1) {
706
-                    $this->debugMsg("\n+++PARSED+++\n" . var_export($_xh['params'], true) . "\n+++END+++");
705
+                if ($this->debug>1) {
706
+                    $this->debugMsg("\n+++PARSED+++\n".var_export($_xh['params'], true)."\n+++END+++");
707 707
                 }
708 708
 
709 709
                 return $this->execute($_xh['method'], $_xh['params'], $_xh['pt']);
@@ -711,12 +711,12 @@  discard block
 block discarded – undo
711 711
                 // build a Request object with data parsed from xml and add parameters in
712 712
                 $req = new Request($_xh['method']);
713 713
                 /// @todo for more speed, we could just pass in the array to the constructor (and loose the type validation)...
714
-                for ($i = 0; $i < count($_xh['params']); $i++) {
714
+                for ($i = 0; $i<count($_xh['params']); $i++) {
715 715
                     $req->addParam($_xh['params'][$i]);
716 716
                 }
717 717
 
718
-                if ($this->debug > 1) {
719
-                    $this->debugMsg("\n+++PARSED+++\n" . var_export($req, true) . "\n+++END+++");
718
+                if ($this->debug>1) {
719
+                    $this->debugMsg("\n+++PARSED+++\n".var_export($req, true)."\n+++END+++");
720 720
                 }
721 721
 
722 722
                 return $this->execute($req);
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
                 return new static::$responseClass(
767 767
                     0,
768 768
                     PhpXmlRpc::$xmlrpcerr['incorrect_params'],
769
-                    PhpXmlRpc::$xmlrpcstr['incorrect_params'] . ": {$errStr}"
769
+                    PhpXmlRpc::$xmlrpcstr['incorrect_params'].": {$errStr}"
770 770
                 );
771 771
             }
772 772
         }
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
         // build string representation of function 'name'
782 782
         if (is_array($func)) {
783 783
             if (is_object($func[0])) {
784
-                $funcName = get_class($func[0]) . '->' . $func[1];
784
+                $funcName = get_class($func[0]).'->'.$func[1];
785 785
             } else {
786 786
                 $funcName = implode('::', $func);
787 787
             }
@@ -793,16 +793,16 @@  discard block
 block discarded – undo
793 793
 
794 794
         // verify that function to be invoked is in fact callable
795 795
         if (!is_callable($func)) {
796
-            $this->getLogger()->error("XML-RPC: " . __METHOD__ . ": function '$funcName' registered as method handler is not callable");
796
+            $this->getLogger()->error("XML-RPC: ".__METHOD__.": function '$funcName' registered as method handler is not callable");
797 797
             return new static::$responseClass(
798 798
                 0,
799 799
                 PhpXmlRpc::$xmlrpcerr['server_error'],
800
-                PhpXmlRpc::$xmlrpcstr['server_error'] . ": no function matches method"
800
+                PhpXmlRpc::$xmlrpcstr['server_error'].": no function matches method"
801 801
             );
802 802
         }
803 803
 
804 804
         if (isset($dmap[$methodName]['exception_handling'])) {
805
-            $exception_handling = (int)$dmap[$methodName]['exception_handling'];
805
+            $exception_handling = (int) $dmap[$methodName]['exception_handling'];
806 806
         } else {
807 807
             $exception_handling = $this->exception_handling;
808 808
         }
@@ -823,14 +823,14 @@  discard block
 block discarded – undo
823 823
                     $r = call_user_func($func, $req);
824 824
                 }
825 825
                 if (!is_a($r, 'PhpXmlRpc\Response')) {
826
-                    $this->getLogger()->error("XML-RPC: " . __METHOD__ . ": function '$funcName' registered as method handler does not return an xmlrpc response object but a " . gettype($r));
826
+                    $this->getLogger()->error("XML-RPC: ".__METHOD__.": function '$funcName' registered as method handler does not return an xmlrpc response object but a ".gettype($r));
827 827
                     if (is_a($r, 'PhpXmlRpc\Value')) {
828 828
                         $r = new static::$responseClass($r);
829 829
                     } else {
830 830
                         $r = new static::$responseClass(
831 831
                             0,
832 832
                             PhpXmlRpc::$xmlrpcerr['server_error'],
833
-                            PhpXmlRpc::$xmlrpcstr['server_error'] . ": function does not return xmlrpc response object"
833
+                            PhpXmlRpc::$xmlrpcstr['server_error'].": function does not return xmlrpc response object"
834 834
                         );
835 835
                     }
836 836
                 }
@@ -845,7 +845,7 @@  discard block
 block discarded – undo
845 845
                         $r = call_user_func_array($func, array($methodName, $params, $this->user_data));
846 846
                         // mimic EPI behaviour: if we get an array that looks like an error, make it an error response
847 847
                         if (is_array($r) && array_key_exists('faultCode', $r) && array_key_exists('faultString', $r)) {
848
-                            $r = new static::$responseClass(0, (int)$r['faultCode'], (string)$r['faultString']);
848
+                            $r = new static::$responseClass(0, (int) $r['faultCode'], (string) $r['faultString']);
849 849
                         } else {
850 850
                             // functions using EPI api should NOT return resp objects, so make sure we encode the
851 851
                             // return type correctly
@@ -931,7 +931,7 @@  discard block
 block discarded – undo
931 931
     protected function generatePayload($resp, $respCharset)
932 932
     {
933 933
         $header = $resp->xml_header($respCharset);
934
-        if ($this->debug > 0) {
934
+        if ($this->debug>0) {
935 935
             $header .= $this->serializeDebug($respCharset);
936 936
         }
937 937
 
@@ -943,7 +943,7 @@  discard block
 block discarded – undo
943 943
             $payload = $resp->serialize($respCharset);
944 944
         }
945 945
 
946
-        return $header . $payload;
946
+        return $header.$payload;
947 947
     }
948 948
 
949 949
     /**
@@ -957,7 +957,7 @@  discard block
 block discarded – undo
957 957
         // if we get a warning/error that has output some text before here, then we cannot
958 958
         // add a new header. We cannot say we are sending xml, either...
959 959
         if (!headers_sent()) {
960
-            header('Content-Type: ' . $respContentType);
960
+            header('Content-Type: '.$respContentType);
961 961
             // we do not know if client actually told us an accepted charset, but if it did we have to tell it what we did
962 962
             header("Vary: Accept-Charset");
963 963
 
@@ -980,12 +980,12 @@  discard block
 block discarded – undo
980 980
             // Note that Apache/mod_php will add (and even alter!) the Content-Length header on its own, but only for
981 981
             // responses up to 8000 bytes
982 982
             if ($phpNoSelfCompress) {
983
-                header('Content-Length: ' . (int)strlen($payload));
983
+                header('Content-Length: '.(int) strlen($payload));
984 984
             }
985 985
         } else {
986 986
             /// @todo allow the user to easily subclass this in a way which allows the resp. headers to be already sent
987 987
             ///       by now without flagging it as an error. Possibly check for presence of Content-Type header
988
-            $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': http headers already sent before response is fully generated. Check for php warning or error messages');
988
+            $this->getLogger()->error('XML-RPC: '.__METHOD__.': http headers already sent before response is fully generated. Check for php warning or error messages');
989 989
         }
990 990
 
991 991
         print $payload;
@@ -1044,7 +1044,7 @@  discard block
 block discarded – undo
1044 1044
      */
1045 1045
     protected function debugMsg($string)
1046 1046
     {
1047
-        $this->debug_info .= $string . "\n";
1047
+        $this->debug_info .= $string."\n";
1048 1048
     }
1049 1049
 
1050 1050
     /**
@@ -1338,7 +1338,7 @@  discard block
 block discarded – undo
1338 1338
                 $i++; // for error message, we count params from 1
1339 1339
                 return static::_xmlrpcs_multicall_error(new static::$responseClass(0,
1340 1340
                     PhpXmlRpc::$xmlrpcerr['incorrect_params'],
1341
-                    PhpXmlRpc::$xmlrpcstr['incorrect_params'] . ": probable xml error in param " . $i));
1341
+                    PhpXmlRpc::$xmlrpcstr['incorrect_params'].": probable xml error in param ".$i));
1342 1342
             }
1343 1343
         }
1344 1344
 
@@ -1419,7 +1419,7 @@  discard block
 block discarded – undo
1419 1419
             }
1420 1420
         } else {
1421 1421
             $numCalls = count($req);
1422
-            for ($i = 0; $i < $numCalls; $i++) {
1422
+            for ($i = 0; $i<$numCalls; $i++) {
1423 1423
                 $result[$i] = static::_xmlrpcs_multicall_do_call_phpvals($server, $req[$i]);
1424 1424
             }
1425 1425
         }
@@ -1447,7 +1447,7 @@  discard block
 block discarded – undo
1447 1447
         // From PHP 8.4 the E_STRICT constant has been deprecated and will emit deprecation notices.
1448 1448
         // PHP core and core extensions since PHP 8.0 and later do not emit E_STRICT notices at all.
1449 1449
         // On PHP 7 series before PHP 7.4, some functions conditionally emit E_STRICT notices.
1450
-        if (PHP_VERSION_ID >= 70400) {
1450
+        if (PHP_VERSION_ID>=70400) {
1451 1451
             static::error_occurred($errString);
1452 1452
         } elseif ($errCode != E_STRICT) {
1453 1453
             static::error_occurred($errString);
@@ -1488,12 +1488,12 @@  discard block
 block discarded – undo
1488 1488
      */
1489 1489
     protected function xml_header($charsetEncoding = '')
1490 1490
     {
1491
-        $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated');
1491
+        $this->logDeprecation('Method '.__METHOD__.' is deprecated');
1492 1492
 
1493 1493
         if ($charsetEncoding != '') {
1494
-            return "<?xml version=\"1.0\" encoding=\"$charsetEncoding\"?" . ">\n";
1494
+            return "<?xml version=\"1.0\" encoding=\"$charsetEncoding\"?".">\n";
1495 1495
         } else {
1496
-            return "<?xml version=\"1.0\"?" . ">\n";
1496
+            return "<?xml version=\"1.0\"?".">\n";
1497 1497
         }
1498 1498
     }
1499 1499
 
@@ -1509,7 +1509,7 @@  discard block
 block discarded – undo
1509 1509
             case self::OPT_FUNCTIONS_PARAMETERS_TYPE:
1510 1510
             case self::OPT_PHPVALS_ENCODING_OPTIONS:
1511 1511
             case self::OPT_RESPONSE_CHARSET_ENCODING:
1512
-                $this->logDeprecation('Getting property Request::' . $name . ' is deprecated');
1512
+                $this->logDeprecation('Getting property Request::'.$name.' is deprecated');
1513 1513
                 return $this->$name;
1514 1514
             case 'accepted_charset_encodings':
1515 1515
                 // manually implement the 'protected property' behaviour
@@ -1521,16 +1521,16 @@  discard block
 block discarded – undo
1521 1521
                     }
1522 1522
                 }
1523 1523
                 if ($canAccess) {
1524
-                    $this->logDeprecation('Getting property Request::' . $name . ' is deprecated');
1524
+                    $this->logDeprecation('Getting property Request::'.$name.' is deprecated');
1525 1525
                     return $this->accepted_compression;
1526 1526
                 } else {
1527
-                    trigger_error("Cannot access protected property Server::accepted_charset_encodings in " . __FILE__, E_USER_ERROR);
1527
+                    trigger_error("Cannot access protected property Server::accepted_charset_encodings in ".__FILE__, E_USER_ERROR);
1528 1528
                 }
1529 1529
                 break;
1530 1530
             default:
1531 1531
                 /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
1532 1532
                 $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
1533
-                trigger_error('Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING);
1533
+                trigger_error('Undefined property via __get(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING);
1534 1534
                 $result = null;
1535 1535
                 return $result;
1536 1536
         }
@@ -1547,7 +1547,7 @@  discard block
 block discarded – undo
1547 1547
             case self::OPT_FUNCTIONS_PARAMETERS_TYPE:
1548 1548
             case self::OPT_PHPVALS_ENCODING_OPTIONS:
1549 1549
             case self::OPT_RESPONSE_CHARSET_ENCODING:
1550
-                $this->logDeprecation('Setting property Request::' . $name . ' is deprecated');
1550
+                $this->logDeprecation('Setting property Request::'.$name.' is deprecated');
1551 1551
                 $this->$name = $value;
1552 1552
                 break;
1553 1553
             case 'accepted_charset_encodings':
@@ -1560,16 +1560,16 @@  discard block
 block discarded – undo
1560 1560
                     }
1561 1561
                 }
1562 1562
                 if ($canAccess) {
1563
-                    $this->logDeprecation('Setting property Request::' . $name . ' is deprecated');
1563
+                    $this->logDeprecation('Setting property Request::'.$name.' is deprecated');
1564 1564
                     $this->accepted_compression = $value;
1565 1565
                 } else {
1566
-                    trigger_error("Cannot access protected property Server::accepted_charset_encodings in " . __FILE__, E_USER_ERROR);
1566
+                    trigger_error("Cannot access protected property Server::accepted_charset_encodings in ".__FILE__, E_USER_ERROR);
1567 1567
                 }
1568 1568
                 break;
1569 1569
             default:
1570 1570
                 /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
1571 1571
                 $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
1572
-                trigger_error('Undefined property via __set(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING);
1572
+                trigger_error('Undefined property via __set(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING);
1573 1573
         }
1574 1574
     }
1575 1575
 
@@ -1584,7 +1584,7 @@  discard block
 block discarded – undo
1584 1584
             case self::OPT_FUNCTIONS_PARAMETERS_TYPE:
1585 1585
             case self::OPT_PHPVALS_ENCODING_OPTIONS:
1586 1586
             case self::OPT_RESPONSE_CHARSET_ENCODING:
1587
-                $this->logDeprecation('Checking property Request::' . $name . ' is deprecated');
1587
+                $this->logDeprecation('Checking property Request::'.$name.' is deprecated');
1588 1588
                 return isset($this->$name);
1589 1589
             case 'accepted_charset_encodings':
1590 1590
                 // manually implement the 'protected property' behaviour
@@ -1596,7 +1596,7 @@  discard block
 block discarded – undo
1596 1596
                     }
1597 1597
                 }
1598 1598
                 if ($canAccess) {
1599
-                    $this->logDeprecation('Checking property Request::' . $name . ' is deprecated');
1599
+                    $this->logDeprecation('Checking property Request::'.$name.' is deprecated');
1600 1600
                     return isset($this->accepted_compression);
1601 1601
                 }
1602 1602
                 // break through voluntarily
@@ -1616,7 +1616,7 @@  discard block
 block discarded – undo
1616 1616
             case self::OPT_FUNCTIONS_PARAMETERS_TYPE:
1617 1617
             case self::OPT_PHPVALS_ENCODING_OPTIONS:
1618 1618
             case self::OPT_RESPONSE_CHARSET_ENCODING:
1619
-                $this->logDeprecation('Unsetting property Request::' . $name . ' is deprecated');
1619
+                $this->logDeprecation('Unsetting property Request::'.$name.' is deprecated');
1620 1620
                 unset($this->$name);
1621 1621
                 break;
1622 1622
             case 'accepted_charset_encodings':
@@ -1629,16 +1629,16 @@  discard block
 block discarded – undo
1629 1629
                     }
1630 1630
                 }
1631 1631
                 if ($canAccess) {
1632
-                    $this->logDeprecation('Unsetting property Request::' . $name . ' is deprecated');
1632
+                    $this->logDeprecation('Unsetting property Request::'.$name.' is deprecated');
1633 1633
                     unset($this->accepted_compression);
1634 1634
                 } else {
1635
-                    trigger_error("Cannot access protected property Server::accepted_charset_encodings in " . __FILE__, E_USER_ERROR);
1635
+                    trigger_error("Cannot access protected property Server::accepted_charset_encodings in ".__FILE__, E_USER_ERROR);
1636 1636
                 }
1637 1637
                 break;
1638 1638
             default:
1639 1639
                 /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout...
1640 1640
                 $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1);
1641
-                trigger_error('Undefined property via __unset(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING);
1641
+                trigger_error('Undefined property via __unset(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING);
1642 1642
         }
1643 1643
     }
1644 1644
 }
Please login to merge, or discard this patch.
demo/vardemo.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
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,25 +10,25 @@  discard block
 block discarded – undo
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 (from timestamp): <PRE>" . htmlentities($v->serialize()) . "</PRE>");
25
+output("Datetime (from timestamp): <PRE>".htmlentities($v->serialize())."</PRE>");
26 26
 $v = new PhpXmlRpc\Value(new DateTime(), 'dateTime.iso8601');
27
-output("Datetime (from php DateTime): <PRE>" . htmlentities($v->serialize()) . "</PRE>");
27
+output("Datetime (from php DateTime): <PRE>".htmlentities($v->serialize())."</PRE>");
28 28
 
29 29
 $v = new PhpXmlRpc\Value('hello world', 'base64');
30
-output("Base64: <PRE>" . htmlentities($v->serialize()) . "</PRE>");
31
-output("(value of base64 string is: '" . $v->scalarVal() . "')<BR><BR>");
30
+output("Base64: <PRE>".htmlentities($v->serialize())."</PRE>");
31
+output("(value of base64 string is: '".$v->scalarVal()."')<BR><BR>");
32 32
 
33 33
 $v = new PhpXmlRpc\Value(
34 34
     array(
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     ),
42 42
     "array"
43 43
 );
44
-output("Array: <PRE>" . htmlentities($v->serialize()) . "</PRE>");
44
+output("Array: <PRE>".htmlentities($v->serialize())."</PRE>");
45 45
 
46 46
 $v = new PhpXmlRpc\Value(
47 47
     array(
@@ -61,10 +61,10 @@  discard block
 block discarded – undo
61 61
     ),
62 62
     "struct"
63 63
 );
64
-output("Struct: <PRE>" . htmlentities($v->serialize()) . "</PRE>");
64
+output("Struct: <PRE>".htmlentities($v->serialize())."</PRE>");
65 65
 
66 66
 $w = new PhpXmlRpc\Value(array($v), 'array');
67
-output("Array containing a struct: <PRE>" . htmlentities($w->serialize()) . "</PRE>");
67
+output("Array containing a struct: <PRE>".htmlentities($w->serialize())."</PRE>");
68 68
 
69 69
 class MyClass
70 70
 {
@@ -76,49 +76,49 @@  discard block
 block discarded – undo
76 76
 // the public property is the only one which will be serialized. As such, it has to be of type Value
77 77
 $myObject->public = new \PhpXmlRpc\Value('a public property, wrapped');
78 78
 $w = new PhpXmlRpc\Value($myObject, 'struct');
79
-output("Struct encoding a php object: <PRE>" . htmlentities($w->serialize()) . "</PRE>");
79
+output("Struct encoding a php object: <PRE>".htmlentities($w->serialize())."</PRE>");
80 80
 
81 81
 output("<h3>Testing value serialization - xml-rpc extensions</h3>\n");
82 82
 $v = new PhpXmlRpc\Value(1234, 'i8');
83
-output("I8: <PRE>" . htmlentities($v->serialize()) . "</PRE>");
83
+output("I8: <PRE>".htmlentities($v->serialize())."</PRE>");
84 84
 $v = new PhpXmlRpc\Value(null, 'null');
85
-output("Null: <PRE>" . htmlentities($v->serialize()) . "</PRE>");
85
+output("Null: <PRE>".htmlentities($v->serialize())."</PRE>");
86 86
 \PhpXmlRpc\PhpXmlRpc::$xmlrpc_null_apache_encoding = true;
87
-output("Null, alternative: <PRE>" . htmlentities($v->serialize()) . "</PRE>");
87
+output("Null, alternative: <PRE>".htmlentities($v->serialize())."</PRE>");
88 88
 
89 89
 output("<h3>Testing value serialization - character encoding</h3>\n");
90 90
 // The greek word 'kosme'
91 91
 $v = new PhpXmlRpc\Value('κόσμε');
92
-output("Greek (default encoding): <PRE>" . htmlentities($v->serialize()) . "</PRE>");
93
-output("Greek (utf8 encoding): <PRE>" . htmlentities($v->serialize('UTF-8')) . "</PRE>");
92
+output("Greek (default encoding): <PRE>".htmlentities($v->serialize())."</PRE>");
93
+output("Greek (utf8 encoding): <PRE>".htmlentities($v->serialize('UTF-8'))."</PRE>");
94 94
 if (function_exists('mb_convert_encoding')) {
95
-    output("Greek (ISO-8859-7 encoding): <PRE>" . htmlentities($v->serialize('ISO-8859-7')) . "</PRE>");
95
+    output("Greek (ISO-8859-7 encoding): <PRE>".htmlentities($v->serialize('ISO-8859-7'))."</PRE>");
96 96
 }
97 97
 
98 98
 output("<h3>Testing request serialization</h3>\n");
99 99
 $req = new PhpXmlRpc\Request('examples.getStateName');
100 100
 $req->method('examples.getStateName');
101 101
 $req->addParam(new PhpXmlRpc\Value(42, 'int'));
102
-output("<PRE>" . htmlentities($req->serialize()) . "</PRE>");
102
+output("<PRE>".htmlentities($req->serialize())."</PRE>");
103 103
 
104 104
 output("<h3>Testing response serialization</h3>\n");
105 105
 $resp = new PhpXmlRpc\Response(new PhpXmlRpc\Value('The meaning of life'));
106
-output("<PRE>" . htmlentities($resp->serialize()) . "</PRE>");
106
+output("<PRE>".htmlentities($resp->serialize())."</PRE>");
107 107
 
108 108
 output("<h3>Testing ISO date formatting</h3><pre>\n");
109 109
 $t = time();
110 110
 $date = PhpXmlRpc\Helper\Date::iso8601Encode($t);
111 111
 output("Now is $t --> $date\n");
112
-output("Or in UTC, that is " . PhpXmlRpc\Helper\Date::iso8601Encode($t, 1) . "\n");
112
+output("Or in UTC, that is ".PhpXmlRpc\Helper\Date::iso8601Encode($t, 1)."\n");
113 113
 $tb = PhpXmlRpc\Helper\Date::iso8601Decode($date);
114 114
 output("That is to say $date --> $tb\n");
115
-output("Which comes out at " . PhpXmlRpc\Helper\Date::iso8601Encode($tb) . "\n");
116
-output("Which was the time in UTC at " . PhpXmlRpc\Helper\Date::iso8601Encode($tb, 1) . "\n");
115
+output("Which comes out at ".PhpXmlRpc\Helper\Date::iso8601Encode($tb)."\n");
116
+output("Which was the time in UTC at ".PhpXmlRpc\Helper\Date::iso8601Encode($tb, 1)."\n");
117 117
 output("</pre>\n");
118 118
 
119 119
 output("<h3>Testing reduced-precision formatting for doubles</h3><pre>\n");
120 120
 $v = new PhpXmlRpc\Value(1234.56789, 'double');
121 121
 \PhpXmlRpc\PhpXmlRpc::$xmlpc_double_precision = 2;
122
-output("Double, limited precision: <PRE>" . htmlentities($v->serialize()) . "</PRE>");
122
+output("Double, limited precision: <PRE>".htmlentities($v->serialize())."</PRE>");
123 123
 
124 124
 output('</body></html>');
Please login to merge, or discard this patch.
demo/server/methodProviders/functions.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -54,11 +54,11 @@  discard block
 block discarded – undo
54 54
         $snv = $sno->scalarVal();
55 55
 
56 56
         // look it up in our array (zero-based)
57
-        if (isset(self::$stateNames[$snv - 1])) {
58
-            $stateName = self::$stateNames[$snv - 1];
57
+        if (isset(self::$stateNames[$snv-1])) {
58
+            $stateName = self::$stateNames[$snv-1];
59 59
         } else {
60 60
             // not there, so complain
61
-            $err = "I don't have a state for the index '" . $snv . "'";
61
+            $err = "I don't have a state for the index '".$snv."'";
62 62
         }
63 63
 
64 64
         if ($err != '') {
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
         $s = $req->getParam(0);
133 133
         $t = $req->getParam(1);
134 134
 
135
-        return new Response(new Value($s->scalarVal() + $t->scalarVal(), Value::$xmlrpcInt));
135
+        return new Response(new Value($s->scalarVal()+$t->scalarVal(), Value::$xmlrpcInt));
136 136
     }
137 137
 
138 138
     public static $addtwodouble_sig = array(array('double', 'double', 'double'));
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
         $s = $req->getParam(0);
143 143
         $t = $req->getParam(1);
144 144
 
145
-        return new Response(new Value($s->scalarVal() + $t->scalarVal(), Value::$xmlrpcDouble));
145
+        return new Response(new Value($s->scalarVal()+$t->scalarVal(), Value::$xmlrpcDouble));
146 146
     }
147 147
 
148 148
     public static $stringecho_sig = array(array('string', 'string'));
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         ///       In fact, we miss some API (or extra data) in the Request...
166 166
         //$payload = file_get_contents('php://input');
167 167
         $payload = $req->serialize(PhpXmlRpc::$xmlrpc_internalencoding);
168
-        $s = "I got the following message:\n" . $payload;
168
+        $s = "I got the following message:\n".$payload;
169 169
 
170 170
         return new Response(new Value($s));
171 171
     }
@@ -238,17 +238,17 @@  discard block
 block discarded – undo
238 238
 
239 239
         /// @todo in real life, we should check for presence of return characters to avoid header injection!
240 240
 
241
-        $msgHdr = "From: " . $mFrom->scalarVal() . "\n";
242
-        $msgHdr .= "To: " . $mTo->scalarVal() . "\n";
241
+        $msgHdr = "From: ".$mFrom->scalarVal()."\n";
242
+        $msgHdr .= "To: ".$mTo->scalarVal()."\n";
243 243
 
244 244
         if ($mCc->scalarVal() != "") {
245
-            $msgHdr .= "Cc: " . $mCc->scalarVal() . "\n";
245
+            $msgHdr .= "Cc: ".$mCc->scalarVal()."\n";
246 246
         }
247 247
         if ($mBcc->scalarVal() != "") {
248
-            $msgHdr .= "Bcc: " . $mBcc->scalarVal() . "\n";
248
+            $msgHdr .= "Bcc: ".$mBcc->scalarVal()."\n";
249 249
         }
250 250
         if ($mMime->scalarVal() != "") {
251
-            $msgHdr .= "Content-type: " . $mMime->scalarVal() . "\n";
251
+            $msgHdr .= "Content-type: ".$mMime->scalarVal()."\n";
252 252
         }
253 253
         $msgHdr .= "X-Mailer: XML-RPC for PHP mailer 1.0";
254 254
 
Please login to merge, or discard this patch.
demo/server/methodProviders/validator1.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
             array(Value::$xmlrpcInt, Value::$xmlrpcArray)
18 18
         ),
19 19
         "docstring" => 'This handler takes a single parameter, an array of structs, each of which contains at least three elements named moe, larry and curly, all <i4>s. Your handler must add all the struct elements named curly and return the result.',
20
-        "function" => function ($req)
20
+        "function" => function($req)
21 21
         {
22 22
             $sno = $req->getParam(0);
23 23
             $numCurly = 0;
@@ -38,13 +38,13 @@  discard block
 block discarded – undo
38 38
             array(Value::$xmlrpcInt, Value::$xmlrpcStruct)
39 39
         ),
40 40
         "docstring" => 'This handler takes a single parameter, a struct, containing at least three elements named moe, larry and curly, all &lt;i4&gt;s. Your handler must add the three numbers and return the result.',
41
-        "function" => function ($req)
41
+        "function" => function($req)
42 42
         {
43 43
             $sno = $req->getParam(0);
44 44
             $moe = $sno["moe"];
45 45
             $larry = $sno["larry"];
46 46
             $curly = $sno["curly"];
47
-            $num = $moe->scalarVal() + $larry->scalarVal() + $curly->scalarVal();
47
+            $num = $moe->scalarVal()+$larry->scalarVal()+$curly->scalarVal();
48 48
 
49 49
             return new Response(new Value($num, Value::$xmlrpcInt));
50 50
         }
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             array(Value::$xmlrpcStruct, Value::$xmlrpcStruct)
56 56
         ),
57 57
         "docstring" => 'This handler takes a single parameter, a struct. Your handler must return the struct.',
58
-        "function" => function ($req)
58
+        "function" => function($req)
59 59
         {
60 60
             $sno = $req->getParam(0);
61 61
 
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             )
72 72
         ),
73 73
         "docstring" => 'This handler takes six parameters, and returns an array containing all the parameters.',
74
-        "function" => function ($req)
74
+        "function" => function($req)
75 75
         {
76 76
             return new Response(new Value(
77 77
                 array(
@@ -92,14 +92,14 @@  discard block
 block discarded – undo
92 92
             array(Value::$xmlrpcString, Value::$xmlrpcArray)
93 93
         ),
94 94
         "docstring" => 'This handler takes a single parameter, which is an array containing between 100 and 200 elements. Each of the items is a string, your handler must return a string containing the concatenated text of the first and last elements.',
95
-        "function" => function ($req)
95
+        "function" => function($req)
96 96
         {
97 97
             $ar = $req->getParam(0);
98 98
             $sz = $ar->count();
99 99
             $first = $ar[0];
100
-            $last = $ar[$sz - 1];
100
+            $last = $ar[$sz-1];
101 101
 
102
-            return new Response(new Value($first->scalarVal() . $last->scalarVal(), Value::$xmlrpcString));
102
+            return new Response(new Value($first->scalarVal().$last->scalarVal(), Value::$xmlrpcString));
103 103
         }
104 104
     ),
105 105
 
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
             array(Value::$xmlrpcStruct, Value::$xmlrpcInt)
109 109
         ),
110 110
         "docstring" => 'This handler takes one parameter, and returns a struct containing three elements, times10, times100 and times1000, the result of multiplying the number by 10, 100 and 1000.',
111
-        "function" => function ($req)
111
+        "function" => function($req)
112 112
         {
113 113
             $sno = $req->getParam(0);
114 114
             $v = $sno->scalarVal();
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             array(Value::$xmlrpcInt, Value::$xmlrpcStruct)
130 130
         ),
131 131
         "docstring" => 'This handler takes a single parameter, a struct, that models a daily calendar. At the top level, there is one struct for each year. Each year is broken down into months, and months into days. Most of the days are empty in the struct you receive, but the entry for April 1, 2000 contains a least three elements named moe, larry and curly, all &lt;i4&gt;s. Your handler must add the three numbers and return the result.',
132
-        "function" => function ($req)
132
+        "function" => function($req)
133 133
         {
134 134
             $sno = $req->getParam(0);
135 135
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
             $larry = $fools["larry"];
141 141
             $moe = $fools["moe"];
142 142
 
143
-            return new Response(new Value($curly->scalarVal() + $larry->scalarVal() + $moe->scalarVal(), Value::$xmlrpcInt));
143
+            return new Response(new Value($curly->scalarVal()+$larry->scalarVal()+$moe->scalarVal(), Value::$xmlrpcInt));
144 144
         }
145 145
     ),
146 146
 
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
             array(Value::$xmlrpcStruct, Value::$xmlrpcString)
150 150
         ),
151 151
         "docstring" => 'This handler takes a single parameter, a string, that contains any number of predefined entities, namely &lt;, &gt;, &amp; \' and ".<BR>Your handler must return a struct that contains five fields, all numbers: ctLeftAngleBrackets, ctRightAngleBrackets, ctAmpersands, ctApostrophes, ctQuotes.',
152
-        "function" => function ($req)
152
+        "function" => function($req)
153 153
         {
154 154
             $sno = $req->getParam(0);
155 155
             $str = $sno->scalarVal();
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
             $ap = 0;
159 159
             $qu = 0;
160 160
             $amp = 0;
161
-            for ($i = 0; $i < strlen($str); $i++) {
161
+            for ($i = 0; $i<strlen($str); $i++) {
162 162
                 $c = substr($str, $i, 1);
163 163
                 switch ($c) {
164 164
                     case ">":
Please login to merge, or discard this patch.
tests/parse_args.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
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 use-case 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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
demo/server/server.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 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;
Please login to merge, or discard this patch.
demo/server/legacy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,8 +10,8 @@
 block discarded – undo
10 10
 // That is generally a good idea security-wise, but you might want to allow it in case of specific needs.
11 11
 // Look at the code in demo/server.php for an example of how to enable that.
12 12
 
13
-require_once __DIR__ . "/../../lib/xmlrpc.inc";
14
-require_once __DIR__ . "/../../lib/xmlrpcs.inc";
13
+require_once __DIR__."/../../lib/xmlrpc.inc";
14
+require_once __DIR__."/../../lib/xmlrpcs.inc";
15 15
 
16 16
 $signatures1 = include(__DIR__.'/methodProviders/functions.php');
17 17
 $signatures2 = include(__DIR__.'/methodProviders/interop.php');
Please login to merge, or discard this patch.
demo/server/methodProviders/testsuite.php 2 patches
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -88,11 +88,12 @@
 block discarded – undo
88 88
     $a = $req->getParam(0);
89 89
     $b = $req->getParam(1);
90 90
 
91
-    if ($a->scalarTyp() == Value::$xmlrpcNull)
92
-        return new Response(new Value(plain_findstate($b->scalarVal())));
93
-    else
94
-        return new Response(new Value(plain_findstate($a->scalarVal())));
95
-}
91
+    if ($a->scalarTyp() == Value::$xmlrpcNull) {
92
+            return new Response(new Value(plain_findstate($b->scalarVal())));
93
+    } else {
94
+            return new Response(new Value(plain_findstate($a->scalarVal())));
95
+    }
96
+    }
96 97
 
97 98
 $sleep_sig = array(array(Value::$xmlrpcInt, Value::$xmlrpcInt));
98 99
 $sleep_doc = 'Sleeps for the requested number of seconds (between 1 and 60), before sending back the response';
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
                 $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
44 44
             } elseif (isset($_SERVER['PHP_AUTH_USER'])) {
45 45
                 $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : '';
46
-                $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass);
46
+                $headers['Authorization'] = 'Basic '.base64_encode($_SERVER['PHP_AUTH_USER'].':'.$basic_pass);
47 47
             } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) {
48 48
                 $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST'];
49 49
             }
@@ -62,12 +62,12 @@  discard block
 block discarded – undo
62 62
     foreach ($cookies as $name => $cookieDesc) {
63 63
         if (is_array($cookieDesc)) {
64 64
             setcookie($name,
65
-                isset($cookieDesc['value']) ? (string)$cookieDesc['value'] : '',
65
+                isset($cookieDesc['value']) ? (string) $cookieDesc['value'] : '',
66 66
                 isset($cookieDesc['expires']) ? $cookieDesc['expires'] : 0,
67
-                isset($cookieDesc['path']) ? (string)$cookieDesc['path'] : '',
68
-                isset($cookieDesc['domain']) ? (string)$cookieDesc['domain'] : '',
69
-                isset($cookieDesc['secure']) ? (bool)$cookieDesc['secure'] : false,
70
-                isset($cookieDesc['httponly']) ? (bool)$cookieDesc['httponly'] : false
67
+                isset($cookieDesc['path']) ? (string) $cookieDesc['path'] : '',
68
+                isset($cookieDesc['domain']) ? (string) $cookieDesc['domain'] : '',
69
+                isset($cookieDesc['secure']) ? (bool) $cookieDesc['secure'] : false,
70
+                isset($cookieDesc['httponly']) ? (bool) $cookieDesc['httponly'] : false
71 71
             );
72 72
         } else {
73 73
             /// @todo what to do?
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 $sleep_sig = array(array(Value::$xmlrpcInt, Value::$xmlrpcInt));
105 105
 $sleep_doc = 'Sleeps for the requested number of seconds (between 1 and 60), before sending back the response';
106 106
 function sleepSeconds($secs) {
107
-    if ($secs > 0 && $secs < 61) {
107
+    if ($secs>0 && $secs<61) {
108 108
         sleep($secs);
109 109
     }
110 110
     return $secs;
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 
138 138
     // Greek word 'kosme'. NB: NOT a valid ISO8859 string!
139 139
     // NB: we can only register this when setting internal encoding to UTF-8, or it will break system.listMethods
140
-    "tests.utf8methodname." . 'κόσμε' => array(
140
+    "tests.utf8methodname.".'κόσμε' => array(
141 141
         "function" => "exampleMethods::stringEcho",
142 142
         "signature" => exampleMethods::$stringecho_sig,
143 143
         "docstring" => exampleMethods::$stringecho_doc,
Please login to merge, or discard this patch.