| @@ -251,7 +251,7 @@ discard block | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | ||
| 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 | } | 
| @@ -683,7 +683,7 @@ discard block | ||
| 683 | 683 |              preg_match('/^XML error ([0-9]+)/', $_xh['isf_reason'], $matches); | 
| 684 | 684 | return new static::$responseClass( | 
| 685 | 685 | 0, | 
| 686 | - PhpXmlRpc::$xmlrpcerrxml + (int)$matches[1], | |
| 686 | + PhpXmlRpc::$xmlrpcerrxml+(int) $matches[1], | |
| 687 | 687 | $_xh['isf_reason']); | 
| 688 | 688 |          } elseif ($_xh['isf']) { | 
| 689 | 689 | /// @todo separate better the various cases, as we have done in Request::parseResponse: invalid xml-rpc vs. | 
| @@ -691,7 +691,7 @@ discard block | ||
| 691 | 691 | return new static::$responseClass( | 
| 692 | 692 | 0, | 
| 693 | 693 | PhpXmlRpc::$xmlrpcerr['invalid_request'], | 
| 694 | - PhpXmlRpc::$xmlrpcstr['invalid_request'] . ' ' . $_xh['isf_reason']); | |
| 694 | + PhpXmlRpc::$xmlrpcstr['invalid_request'].' '.$_xh['isf_reason']); | |
| 695 | 695 |          } else { | 
| 696 | 696 | // small layering violation in favor of speed and memory usage: we should allow the 'execute' method handle | 
| 697 | 697 | // this, but in the most common scenario (xml-rpc values type server with some methods registered as phpvals) | 
| @@ -701,8 +701,8 @@ discard block | ||
| 701 | 701 | ($this->dmap[$_xh['method']]['parameters_type'] != 'xmlrpcvals') | 
| 702 | 702 | ) | 
| 703 | 703 |              ) { | 
| 704 | -                if ($this->debug > 1) { | |
| 705 | -                    $this->debugMsg("\n+++PARSED+++\n" . var_export($_xh['params'], true) . "\n+++END+++"); | |
| 704 | +                if ($this->debug>1) { | |
| 705 | +                    $this->debugMsg("\n+++PARSED+++\n".var_export($_xh['params'], true)."\n+++END+++"); | |
| 706 | 706 | } | 
| 707 | 707 | |
| 708 | 708 | return $this->execute($_xh['method'], $_xh['params'], $_xh['pt']); | 
| @@ -710,12 +710,12 @@ discard block | ||
| 710 | 710 | // build a Request object with data parsed from xml and add parameters in | 
| 711 | 711 | $req = new Request($_xh['method']); | 
| 712 | 712 | /// @todo for more speed, we could just pass in the array to the constructor (and loose the type validation)... | 
| 713 | -                for ($i = 0; $i < count($_xh['params']); $i++) { | |
| 713 | +                for ($i = 0; $i<count($_xh['params']); $i++) { | |
| 714 | 714 | $req->addParam($_xh['params'][$i]); | 
| 715 | 715 | } | 
| 716 | 716 | |
| 717 | -                if ($this->debug > 1) { | |
| 718 | -                    $this->debugMsg("\n+++PARSED+++\n" . var_export($req, true) . "\n+++END+++"); | |
| 717 | +                if ($this->debug>1) { | |
| 718 | +                    $this->debugMsg("\n+++PARSED+++\n".var_export($req, true)."\n+++END+++"); | |
| 719 | 719 | } | 
| 720 | 720 | |
| 721 | 721 | return $this->execute($req); | 
| @@ -765,7 +765,7 @@ discard block | ||
| 765 | 765 | return new static::$responseClass( | 
| 766 | 766 | 0, | 
| 767 | 767 | PhpXmlRpc::$xmlrpcerr['incorrect_params'], | 
| 768 | -                    PhpXmlRpc::$xmlrpcstr['incorrect_params'] . ": {$errStr}" | |
| 768 | +                    PhpXmlRpc::$xmlrpcstr['incorrect_params'].": {$errStr}" | |
| 769 | 769 | ); | 
| 770 | 770 | } | 
| 771 | 771 | } | 
| @@ -780,7 +780,7 @@ discard block | ||
| 780 | 780 | // build string representation of function 'name' | 
| 781 | 781 |          if (is_array($func)) { | 
| 782 | 782 |              if (is_object($func[0])) { | 
| 783 | - $funcName = get_class($func[0]) . '->' . $func[1]; | |
| 783 | + $funcName = get_class($func[0]).'->'.$func[1]; | |
| 784 | 784 |              } else { | 
| 785 | 785 |                  $funcName = implode('::', $func); | 
| 786 | 786 | } | 
| @@ -792,16 +792,16 @@ discard block | ||
| 792 | 792 | |
| 793 | 793 | // verify that function to be invoked is in fact callable | 
| 794 | 794 |          if (!is_callable($func)) { | 
| 795 | -            $this->getLogger()->error("XML-RPC: " . __METHOD__ . ": function '$funcName' registered as method handler is not callable"); | |
| 795 | +            $this->getLogger()->error("XML-RPC: ".__METHOD__.": function '$funcName' registered as method handler is not callable"); | |
| 796 | 796 | return new static::$responseClass( | 
| 797 | 797 | 0, | 
| 798 | 798 | PhpXmlRpc::$xmlrpcerr['server_error'], | 
| 799 | - PhpXmlRpc::$xmlrpcstr['server_error'] . ": no function matches method" | |
| 799 | + PhpXmlRpc::$xmlrpcstr['server_error'].": no function matches method" | |
| 800 | 800 | ); | 
| 801 | 801 | } | 
| 802 | 802 | |
| 803 | 803 |          if (isset($dmap[$methodName]['exception_handling'])) { | 
| 804 | - $exception_handling = (int)$dmap[$methodName]['exception_handling']; | |
| 804 | + $exception_handling = (int) $dmap[$methodName]['exception_handling']; | |
| 805 | 805 |          } else { | 
| 806 | 806 | $exception_handling = $this->exception_handling; | 
| 807 | 807 | } | 
| @@ -822,14 +822,14 @@ discard block | ||
| 822 | 822 | $r = call_user_func($func, $req); | 
| 823 | 823 | } | 
| 824 | 824 |                  if (!is_a($r, 'PhpXmlRpc\Response')) { | 
| 825 | -                    $this->getLogger()->error("XML-RPC: " . __METHOD__ . ": function '$funcName' registered as method handler does not return an xmlrpc response object but a " . gettype($r)); | |
| 825 | +                    $this->getLogger()->error("XML-RPC: ".__METHOD__.": function '$funcName' registered as method handler does not return an xmlrpc response object but a ".gettype($r)); | |
| 826 | 826 |                      if (is_a($r, 'PhpXmlRpc\Value')) { | 
| 827 | 827 | $r = new static::$responseClass($r); | 
| 828 | 828 |                      } else { | 
| 829 | 829 | $r = new static::$responseClass( | 
| 830 | 830 | 0, | 
| 831 | 831 | PhpXmlRpc::$xmlrpcerr['server_error'], | 
| 832 | - PhpXmlRpc::$xmlrpcstr['server_error'] . ": function does not return xmlrpc response object" | |
| 832 | + PhpXmlRpc::$xmlrpcstr['server_error'].": function does not return xmlrpc response object" | |
| 833 | 833 | ); | 
| 834 | 834 | } | 
| 835 | 835 | } | 
| @@ -844,7 +844,7 @@ discard block | ||
| 844 | 844 | $r = call_user_func_array($func, array($methodName, $params, $this->user_data)); | 
| 845 | 845 | // mimic EPI behaviour: if we get an array that looks like an error, make it an error response | 
| 846 | 846 |                          if (is_array($r) && array_key_exists('faultCode', $r) && array_key_exists('faultString', $r)) { | 
| 847 | - $r = new static::$responseClass(0, (int)$r['faultCode'], (string)$r['faultString']); | |
| 847 | + $r = new static::$responseClass(0, (int) $r['faultCode'], (string) $r['faultString']); | |
| 848 | 848 |                          } else { | 
| 849 | 849 | // functions using EPI api should NOT return resp objects, so make sure we encode the | 
| 850 | 850 | // return type correctly | 
| @@ -930,7 +930,7 @@ discard block | ||
| 930 | 930 | protected function generatePayload($resp, $respCharset) | 
| 931 | 931 |      { | 
| 932 | 932 | $header = $resp->xml_header($respCharset); | 
| 933 | -        if ($this->debug > 0) { | |
| 933 | +        if ($this->debug>0) { | |
| 934 | 934 | $header .= $this->serializeDebug($respCharset); | 
| 935 | 935 | } | 
| 936 | 936 | |
| @@ -942,7 +942,7 @@ discard block | ||
| 942 | 942 | $payload = $resp->serialize($respCharset); | 
| 943 | 943 | } | 
| 944 | 944 | |
| 945 | - return $header . $payload; | |
| 945 | + return $header.$payload; | |
| 946 | 946 | } | 
| 947 | 947 | |
| 948 | 948 | /** | 
| @@ -956,7 +956,7 @@ discard block | ||
| 956 | 956 | // if we get a warning/error that has output some text before here, then we cannot | 
| 957 | 957 | // add a new header. We cannot say we are sending xml, either... | 
| 958 | 958 |          if (!headers_sent()) { | 
| 959 | -            header('Content-Type: ' . $respContentType); | |
| 959 | +            header('Content-Type: '.$respContentType); | |
| 960 | 960 | // we do not know if client actually told us an accepted charset, but if it did we have to tell it what we did | 
| 961 | 961 |              header("Vary: Accept-Charset"); | 
| 962 | 962 | |
| @@ -979,12 +979,12 @@ discard block | ||
| 979 | 979 | // Note that Apache/mod_php will add (and even alter!) the Content-Length header on its own, but only for | 
| 980 | 980 | // responses up to 8000 bytes | 
| 981 | 981 |              if ($phpNoSelfCompress) { | 
| 982 | -                header('Content-Length: ' . (int)strlen($payload)); | |
| 982 | +                header('Content-Length: '.(int) strlen($payload)); | |
| 983 | 983 | } | 
| 984 | 984 |          } else { | 
| 985 | 985 | /// @todo allow the user to easily subclass this in a way which allows the resp. headers to be already sent | 
| 986 | 986 | /// by now without flagging it as an error. Possibly check for presence of Content-Type header | 
| 987 | -            $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': http headers already sent before response is fully generated. Check for php warning or error messages'); | |
| 987 | +            $this->getLogger()->error('XML-RPC: '.__METHOD__.': http headers already sent before response is fully generated. Check for php warning or error messages'); | |
| 988 | 988 | } | 
| 989 | 989 | |
| 990 | 990 | print $payload; | 
| @@ -1043,7 +1043,7 @@ discard block | ||
| 1043 | 1043 | */ | 
| 1044 | 1044 | protected function debugMsg($string) | 
| 1045 | 1045 |      { | 
| 1046 | - $this->debug_info .= $string . "\n"; | |
| 1046 | + $this->debug_info .= $string."\n"; | |
| 1047 | 1047 | } | 
| 1048 | 1048 | |
| 1049 | 1049 | /** | 
| @@ -1335,7 +1335,7 @@ discard block | ||
| 1335 | 1335 | $i++; // for error message, we count params from 1 | 
| 1336 | 1336 | return static::_xmlrpcs_multicall_error(new static::$responseClass(0, | 
| 1337 | 1337 | PhpXmlRpc::$xmlrpcerr['incorrect_params'], | 
| 1338 | - PhpXmlRpc::$xmlrpcstr['incorrect_params'] . ": probable xml error in param " . $i)); | |
| 1338 | + PhpXmlRpc::$xmlrpcstr['incorrect_params'].": probable xml error in param ".$i)); | |
| 1339 | 1339 | } | 
| 1340 | 1340 | } | 
| 1341 | 1341 | |
| @@ -1416,7 +1416,7 @@ discard block | ||
| 1416 | 1416 | } | 
| 1417 | 1417 |          } else { | 
| 1418 | 1418 | $numCalls = count($req); | 
| 1419 | -            for ($i = 0; $i < $numCalls; $i++) { | |
| 1419 | +            for ($i = 0; $i<$numCalls; $i++) { | |
| 1420 | 1420 | $result[$i] = static::_xmlrpcs_multicall_do_call_phpvals($server, $req[$i]); | 
| 1421 | 1421 | } | 
| 1422 | 1422 | } | 
| @@ -1444,7 +1444,7 @@ discard block | ||
| 1444 | 1444 | // From PHP 8.4 the E_STRICT constant has been deprecated and will emit deprecation notices. | 
| 1445 | 1445 | // PHP core and core extensions since PHP 8.0 and later do not emit E_STRICT notices at all. | 
| 1446 | 1446 | // On PHP 7 series before PHP 7.4, some functions conditionally emit E_STRICT notices. | 
| 1447 | -        if (PHP_VERSION_ID >= 70400) { | |
| 1447 | +        if (PHP_VERSION_ID>=70400) { | |
| 1448 | 1448 | static::error_occurred($errString); | 
| 1449 | 1449 |          } elseif ($errCode != E_STRICT) { | 
| 1450 | 1450 | static::error_occurred($errString); | 
| @@ -1485,12 +1485,12 @@ discard block | ||
| 1485 | 1485 | */ | 
| 1486 | 1486 | protected function xml_header($charsetEncoding = '') | 
| 1487 | 1487 |      { | 
| 1488 | -        $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); | |
| 1488 | +        $this->logDeprecation('Method '.__METHOD__.' is deprecated'); | |
| 1489 | 1489 | |
| 1490 | 1490 |          if ($charsetEncoding != '') { | 
| 1491 | - return "<?xml version=\"1.0\" encoding=\"$charsetEncoding\"?" . ">\n"; | |
| 1491 | + return "<?xml version=\"1.0\" encoding=\"$charsetEncoding\"?".">\n"; | |
| 1492 | 1492 |          } else { | 
| 1493 | - return "<?xml version=\"1.0\"?" . ">\n"; | |
| 1493 | + return "<?xml version=\"1.0\"?".">\n"; | |
| 1494 | 1494 | } | 
| 1495 | 1495 | } | 
| 1496 | 1496 | |
| @@ -1506,7 +1506,7 @@ discard block | ||
| 1506 | 1506 | case self::OPT_FUNCTIONS_PARAMETERS_TYPE: | 
| 1507 | 1507 | case self::OPT_PHPVALS_ENCODING_OPTIONS: | 
| 1508 | 1508 | case self::OPT_RESPONSE_CHARSET_ENCODING: | 
| 1509 | -                $this->logDeprecation('Getting property Request::' . $name . ' is deprecated'); | |
| 1509 | +                $this->logDeprecation('Getting property Request::'.$name.' is deprecated'); | |
| 1510 | 1510 | return $this->$name; | 
| 1511 | 1511 | case 'accepted_charset_encodings': | 
| 1512 | 1512 | // manually implement the 'protected property' behaviour | 
| @@ -1518,16 +1518,16 @@ discard block | ||
| 1518 | 1518 | } | 
| 1519 | 1519 | } | 
| 1520 | 1520 |                  if ($canAccess) { | 
| 1521 | -                    $this->logDeprecation('Getting property Request::' . $name . ' is deprecated'); | |
| 1521 | +                    $this->logDeprecation('Getting property Request::'.$name.' is deprecated'); | |
| 1522 | 1522 | return $this->accepted_compression; | 
| 1523 | 1523 |                  } else { | 
| 1524 | -                    trigger_error("Cannot access protected property Server::accepted_charset_encodings in " . __FILE__, E_USER_ERROR); | |
| 1524 | +                    trigger_error("Cannot access protected property Server::accepted_charset_encodings in ".__FILE__, E_USER_ERROR); | |
| 1525 | 1525 | } | 
| 1526 | 1526 | break; | 
| 1527 | 1527 | default: | 
| 1528 | 1528 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... | 
| 1529 | 1529 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); | 
| 1530 | -                trigger_error('Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); | |
| 1530 | +                trigger_error('Undefined property via __get(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); | |
| 1531 | 1531 | $result = null; | 
| 1532 | 1532 | return $result; | 
| 1533 | 1533 | } | 
| @@ -1544,7 +1544,7 @@ discard block | ||
| 1544 | 1544 | case self::OPT_FUNCTIONS_PARAMETERS_TYPE: | 
| 1545 | 1545 | case self::OPT_PHPVALS_ENCODING_OPTIONS: | 
| 1546 | 1546 | case self::OPT_RESPONSE_CHARSET_ENCODING: | 
| 1547 | -                $this->logDeprecation('Setting property Request::' . $name . ' is deprecated'); | |
| 1547 | +                $this->logDeprecation('Setting property Request::'.$name.' is deprecated'); | |
| 1548 | 1548 | $this->$name = $value; | 
| 1549 | 1549 | break; | 
| 1550 | 1550 | case 'accepted_charset_encodings': | 
| @@ -1557,16 +1557,16 @@ discard block | ||
| 1557 | 1557 | } | 
| 1558 | 1558 | } | 
| 1559 | 1559 |                  if ($canAccess) { | 
| 1560 | -                    $this->logDeprecation('Setting property Request::' . $name . ' is deprecated'); | |
| 1560 | +                    $this->logDeprecation('Setting property Request::'.$name.' is deprecated'); | |
| 1561 | 1561 | $this->accepted_compression = $value; | 
| 1562 | 1562 |                  } else { | 
| 1563 | -                    trigger_error("Cannot access protected property Server::accepted_charset_encodings in " . __FILE__, E_USER_ERROR); | |
| 1563 | +                    trigger_error("Cannot access protected property Server::accepted_charset_encodings in ".__FILE__, E_USER_ERROR); | |
| 1564 | 1564 | } | 
| 1565 | 1565 | break; | 
| 1566 | 1566 | default: | 
| 1567 | 1567 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... | 
| 1568 | 1568 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); | 
| 1569 | -                trigger_error('Undefined property via __set(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); | |
| 1569 | +                trigger_error('Undefined property via __set(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); | |
| 1570 | 1570 | } | 
| 1571 | 1571 | } | 
| 1572 | 1572 | |
| @@ -1581,7 +1581,7 @@ discard block | ||
| 1581 | 1581 | case self::OPT_FUNCTIONS_PARAMETERS_TYPE: | 
| 1582 | 1582 | case self::OPT_PHPVALS_ENCODING_OPTIONS: | 
| 1583 | 1583 | case self::OPT_RESPONSE_CHARSET_ENCODING: | 
| 1584 | -                $this->logDeprecation('Checking property Request::' . $name . ' is deprecated'); | |
| 1584 | +                $this->logDeprecation('Checking property Request::'.$name.' is deprecated'); | |
| 1585 | 1585 | return isset($this->$name); | 
| 1586 | 1586 | case 'accepted_charset_encodings': | 
| 1587 | 1587 | // manually implement the 'protected property' behaviour | 
| @@ -1593,7 +1593,7 @@ discard block | ||
| 1593 | 1593 | } | 
| 1594 | 1594 | } | 
| 1595 | 1595 |                  if ($canAccess) { | 
| 1596 | -                    $this->logDeprecation('Checking property Request::' . $name . ' is deprecated'); | |
| 1596 | +                    $this->logDeprecation('Checking property Request::'.$name.' is deprecated'); | |
| 1597 | 1597 | return isset($this->accepted_compression); | 
| 1598 | 1598 | } | 
| 1599 | 1599 | // break through voluntarily | 
| @@ -1613,7 +1613,7 @@ discard block | ||
| 1613 | 1613 | case self::OPT_FUNCTIONS_PARAMETERS_TYPE: | 
| 1614 | 1614 | case self::OPT_PHPVALS_ENCODING_OPTIONS: | 
| 1615 | 1615 | case self::OPT_RESPONSE_CHARSET_ENCODING: | 
| 1616 | -                $this->logDeprecation('Unsetting property Request::' . $name . ' is deprecated'); | |
| 1616 | +                $this->logDeprecation('Unsetting property Request::'.$name.' is deprecated'); | |
| 1617 | 1617 | unset($this->$name); | 
| 1618 | 1618 | break; | 
| 1619 | 1619 | case 'accepted_charset_encodings': | 
| @@ -1626,16 +1626,16 @@ discard block | ||
| 1626 | 1626 | } | 
| 1627 | 1627 | } | 
| 1628 | 1628 |                  if ($canAccess) { | 
| 1629 | -                    $this->logDeprecation('Unsetting property Request::' . $name . ' is deprecated'); | |
| 1629 | +                    $this->logDeprecation('Unsetting property Request::'.$name.' is deprecated'); | |
| 1630 | 1630 | unset($this->accepted_compression); | 
| 1631 | 1631 |                  } else { | 
| 1632 | -                    trigger_error("Cannot access protected property Server::accepted_charset_encodings in " . __FILE__, E_USER_ERROR); | |
| 1632 | +                    trigger_error("Cannot access protected property Server::accepted_charset_encodings in ".__FILE__, E_USER_ERROR); | |
| 1633 | 1633 | } | 
| 1634 | 1634 | break; | 
| 1635 | 1635 | default: | 
| 1636 | 1636 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... | 
| 1637 | 1637 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); | 
| 1638 | -                trigger_error('Undefined property via __unset(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); | |
| 1638 | +                trigger_error('Undefined property via __unset(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); | |
| 1639 | 1639 | } | 
| 1640 | 1640 | } | 
| 1641 | 1641 | } | 
| @@ -28,12 +28,12 @@ discard block | ||
| 28 | 28 | |
| 29 | 29 | // read chunk-size, chunk-extension (if any) and crlf | 
| 30 | 30 | // get the position of the linebreak | 
| 31 | - $chunkEnd = strpos($buffer, "\r\n") + 2; | |
| 31 | + $chunkEnd = strpos($buffer, "\r\n")+2; | |
| 32 | 32 | $temp = substr($buffer, 0, $chunkEnd); | 
| 33 | 33 | $chunkSize = hexdec(trim($temp)); | 
| 34 | 34 | $chunkStart = $chunkEnd; | 
| 35 | -        while ($chunkSize > 0) { | |
| 36 | - $chunkEnd = strpos($buffer, "\r\n", $chunkStart + $chunkSize); | |
| 35 | +        while ($chunkSize>0) { | |
| 36 | + $chunkEnd = strpos($buffer, "\r\n", $chunkStart+$chunkSize); | |
| 37 | 37 | |
| 38 | 38 | // just in case we got a broken connection | 
| 39 | 39 |              if ($chunkEnd == false) { | 
| @@ -45,19 +45,19 @@ discard block | ||
| 45 | 45 | } | 
| 46 | 46 | |
| 47 | 47 | // read chunk-data and crlf | 
| 48 | - $chunk = substr($buffer, $chunkStart, $chunkEnd - $chunkStart); | |
| 48 | + $chunk = substr($buffer, $chunkStart, $chunkEnd-$chunkStart); | |
| 49 | 49 | // append chunk-data to entity-body | 
| 50 | 50 | $new .= $chunk; | 
| 51 | 51 | // length := length + chunk-size | 
| 52 | 52 | $length += strlen($chunk); | 
| 53 | 53 | // read chunk-size and crlf | 
| 54 | - $chunkStart = $chunkEnd + 2; | |
| 54 | + $chunkStart = $chunkEnd+2; | |
| 55 | 55 | |
| 56 | - $chunkEnd = strpos($buffer, "\r\n", $chunkStart) + 2; | |
| 56 | + $chunkEnd = strpos($buffer, "\r\n", $chunkStart)+2; | |
| 57 | 57 |              if ($chunkEnd == false) { | 
| 58 | 58 | break; // just in case we got a broken connection | 
| 59 | 59 | } | 
| 60 | - $temp = substr($buffer, $chunkStart, $chunkEnd - $chunkStart); | |
| 60 | + $temp = substr($buffer, $chunkStart, $chunkEnd-$chunkStart); | |
| 61 | 61 | $chunkSize = hexdec(trim($temp)); | 
| 62 | 62 | $chunkStart = $chunkEnd; | 
| 63 | 63 | } | 
| @@ -86,11 +86,11 @@ discard block | ||
| 86 | 86 | // Look for CR/LF or simple LF as line separator (even though it is not valid http) | 
| 87 | 87 | $pos = strpos($data, "\r\n\r\n"); | 
| 88 | 88 |              if ($pos || is_int($pos)) { | 
| 89 | - $bd = $pos + 4; | |
| 89 | + $bd = $pos+4; | |
| 90 | 90 |              } else { | 
| 91 | 91 | $pos = strpos($data, "\n\n"); | 
| 92 | 92 |                  if ($pos || is_int($pos)) { | 
| 93 | - $bd = $pos + 2; | |
| 93 | + $bd = $pos+2; | |
| 94 | 94 |                  } else { | 
| 95 | 95 | // No separation between response headers and body: fault? | 
| 96 | 96 | $bd = 0; | 
| @@ -100,8 +100,8 @@ discard block | ||
| 100 | 100 | // this filters out all http headers from proxy. maybe we could take them into account, too? | 
| 101 | 101 | $data = substr($data, $bd); | 
| 102 | 102 |              } else { | 
| 103 | -                $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': HTTPS via proxy error, tunnel connection possibly failed'); | |
| 104 | - throw new HttpException(PhpXmlRpc::$xmlrpcstr['http_error'] . ' (HTTPS via proxy error, tunnel connection possibly failed)', PhpXmlRpc::$xmlrpcerr['http_error']); | |
| 103 | +                $this->getLogger()->error('XML-RPC: '.__METHOD__.': HTTPS via proxy error, tunnel connection possibly failed'); | |
| 104 | + throw new HttpException(PhpXmlRpc::$xmlrpcstr['http_error'].' (HTTPS via proxy error, tunnel connection possibly failed)', PhpXmlRpc::$xmlrpcerr['http_error']); | |
| 105 | 105 | } | 
| 106 | 106 | } | 
| 107 | 107 | |
| @@ -134,19 +134,19 @@ discard block | ||
| 134 | 134 | } | 
| 135 | 135 | |
| 136 | 136 |          if (!in_array($httpResponse['status_code'], $this->acceptedStatusCodes)) { | 
| 137 | - $errstr = substr($data, 0, strpos($data, "\n") - 1); | |
| 138 | -            $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': HTTP error, got response: ' . $errstr); | |
| 139 | -            throw new HttpException(PhpXmlRpc::$xmlrpcstr['http_error'] . ' (' . $errstr . ')', PhpXmlRpc::$xmlrpcerr['http_error'], null, $httpResponse['status_code']); | |
| 137 | + $errstr = substr($data, 0, strpos($data, "\n")-1); | |
| 138 | +            $this->getLogger()->error('XML-RPC: '.__METHOD__.': HTTP error, got response: '.$errstr); | |
| 139 | +            throw new HttpException(PhpXmlRpc::$xmlrpcstr['http_error'].' ('.$errstr.')', PhpXmlRpc::$xmlrpcerr['http_error'], null, $httpResponse['status_code']); | |
| 140 | 140 | } | 
| 141 | 141 | |
| 142 | 142 | // be tolerant to usage of \n instead of \r\n to separate headers and data (even though it is not valid http) | 
| 143 | 143 | $pos = strpos($data, "\r\n\r\n"); | 
| 144 | 144 |          if ($pos || is_int($pos)) { | 
| 145 | - $bd = $pos + 4; | |
| 145 | + $bd = $pos+4; | |
| 146 | 146 |          } else { | 
| 147 | 147 | $pos = strpos($data, "\n\n"); | 
| 148 | 148 |              if ($pos || is_int($pos)) { | 
| 149 | - $bd = $pos + 2; | |
| 149 | + $bd = $pos+2; | |
| 150 | 150 |              } else { | 
| 151 | 151 | // No separation between response headers and body: fault? | 
| 152 | 152 | // we could take some action here instead of going on... | 
| @@ -160,7 +160,7 @@ discard block | ||
| 160 | 160 |          foreach ($ar as $line) { | 
| 161 | 161 | // take care of (multi-line) headers and cookies | 
| 162 | 162 |              $arr = explode(':', $line, 2); | 
| 163 | -            if (count($arr) > 1) { | |
| 163 | +            if (count($arr)>1) { | |
| 164 | 164 | /// @todo according to https://www.rfc-editor.org/rfc/rfc7230#section-3.2.4, we should reject with error | 
| 165 | 165 | /// 400 any messages where a space is present between the header name and colon | 
| 166 | 166 | $headerName = strtolower(trim($arr[0])); | 
| @@ -168,7 +168,7 @@ discard block | ||
| 168 | 168 | $cookie = $arr[1]; | 
| 169 | 169 | // glue together all received cookies, using a comma to separate them (same as php does with getallheaders()) | 
| 170 | 170 |                      if (isset($httpResponse['headers'][$headerName])) { | 
| 171 | - $httpResponse['headers'][$headerName] .= ', ' . trim($cookie); | |
| 171 | + $httpResponse['headers'][$headerName] .= ', '.trim($cookie); | |
| 172 | 172 |                      } else { | 
| 173 | 173 | $httpResponse['headers'][$headerName] = trim($cookie); | 
| 174 | 174 | } | 
| @@ -199,7 +199,7 @@ discard block | ||
| 199 | 199 |              } elseif (isset($headerName)) { | 
| 200 | 200 | /// @todo improve this: 1. check that the line starts with a space or tab; 2. according to | 
| 201 | 201 | /// https://www.rfc-editor.org/rfc/rfc7230#section-3.2.4, we should flat out refuse these messages | 
| 202 | - $httpResponse['headers'][$headerName] .= ' ' . trim($line); | |
| 202 | + $httpResponse['headers'][$headerName] .= ' '.trim($line); | |
| 203 | 203 | } | 
| 204 | 204 | } | 
| 205 | 205 | |
| @@ -222,7 +222,7 @@ discard block | ||
| 222 | 222 | // Decode chunked encoding sent by http 1.1 servers | 
| 223 | 223 |              if (isset($httpResponse['headers']['transfer-encoding']) && $httpResponse['headers']['transfer-encoding'] == 'chunked') { | 
| 224 | 224 |                  if (!$data = static::decodeChunked($data)) { | 
| 225 | -                    $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': errors occurred when trying to rebuild the chunked data received from server'); | |
| 225 | +                    $this->getLogger()->error('XML-RPC: '.__METHOD__.': errors occurred when trying to rebuild the chunked data received from server'); | |
| 226 | 226 | throw new HttpException(PhpXmlRpc::$xmlrpcstr['dechunk_fail'], PhpXmlRpc::$xmlrpcerr['dechunk_fail'], null, $httpResponse['status_code']); | 
| 227 | 227 | } | 
| 228 | 228 | } | 
| @@ -237,19 +237,19 @@ discard block | ||
| 237 | 237 |                          if ($httpResponse['headers']['content-encoding'] == 'deflate' && $degzdata = @gzuncompress($data)) { | 
| 238 | 238 | $data = $degzdata; | 
| 239 | 239 |                              if ($debug) { | 
| 240 | -                                $this->getLogger()->debug("---INFLATED RESPONSE---[" . strlen($data) . " chars]---\n$data\n---END---"); | |
| 240 | +                                $this->getLogger()->debug("---INFLATED RESPONSE---[".strlen($data)." chars]---\n$data\n---END---"); | |
| 241 | 241 | } | 
| 242 | 242 |                          } elseif ($httpResponse['headers']['content-encoding'] == 'gzip' && $degzdata = @gzinflate(substr($data, 10))) { | 
| 243 | 243 | $data = $degzdata; | 
| 244 | 244 |                              if ($debug) { | 
| 245 | -                                $this->getLogger()->debug("---INFLATED RESPONSE---[" . strlen($data) . " chars]---\n$data\n---END---"); | |
| 245 | +                                $this->getLogger()->debug("---INFLATED RESPONSE---[".strlen($data)." chars]---\n$data\n---END---"); | |
| 246 | 246 | } | 
| 247 | 247 |                          } else { | 
| 248 | -                            $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': errors occurred when trying to decode the deflated data received from server'); | |
| 248 | +                            $this->getLogger()->error('XML-RPC: '.__METHOD__.': errors occurred when trying to decode the deflated data received from server'); | |
| 249 | 249 | throw new HttpException(PhpXmlRpc::$xmlrpcstr['decompress_fail'], PhpXmlRpc::$xmlrpcerr['decompress_fail'], null, $httpResponse['status_code']); | 
| 250 | 250 | } | 
| 251 | 251 |                      } else { | 
| 252 | -                        $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': the server sent deflated data. Your php install must have the Zlib extension compiled in to support this.'); | |
| 252 | +                        $this->getLogger()->error('XML-RPC: '.__METHOD__.': the server sent deflated data. Your php install must have the Zlib extension compiled in to support this.'); | |
| 253 | 253 | throw new HttpException(PhpXmlRpc::$xmlrpcstr['cannot_decompress'], PhpXmlRpc::$xmlrpcerr['cannot_decompress'], null, $httpResponse['status_code']); | 
| 254 | 254 | } | 
| 255 | 255 | } | 
| @@ -269,7 +269,7 @@ discard block | ||
| 269 | 269 | public function parseAcceptHeader($header) | 
| 270 | 270 |      { | 
| 271 | 271 | $accepted = array(); | 
| 272 | -        foreach(explode(',', $header) as $c) { | |
| 272 | +        foreach (explode(',', $header) as $c) { | |
| 273 | 273 |              if (preg_match('/^([^;]+); *q=([0-9.]+)/', $c, $matches)) { | 
| 274 | 274 | $c = $matches[1]; | 
| 275 | 275 | $w = $matches[2]; |