@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once __DIR__ . '/08ServerTest.php'; |
|
3 | +include_once __DIR__.'/08ServerTest.php'; |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Tests which stress http features of the library. |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | { |
29 | 29 | $methods = array(); |
30 | 30 | // as long as we are descendants, get_class_methods will list private/protected methods |
31 | - foreach(get_class_methods('ServerTest') as $method) |
|
31 | + foreach (get_class_methods('ServerTest') as $method) |
|
32 | 32 | { |
33 | 33 | if (strpos($method, 'test') === 0 && !in_array($method, $this->unsafeMethods)) |
34 | 34 | { |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | preg_match('/ubunutu([0-9]+)/', $output[0], $matches); |
331 | 331 | $ubuntuVersion = @$matches[1]; |
332 | 332 | } |
333 | - if ($ubuntuVersion >= 20 && $this->args['SSLVERSION'] != 6) { |
|
333 | + if ($ubuntuVersion>=20 && $this->args['SSLVERSION'] != 6) { |
|
334 | 334 | $this->markTestSkipped('HTTPS via Socket known to fail on php less than 7.2 on Ubuntu 20 and higher'); |
335 | 335 | return; |
336 | 336 | } |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | $this->client->setOption(\PhpXmlRpc\Client::OPT_EXTRA_SOCKET_OPTS, |
357 | 357 | array('ssl' => array( |
358 | 358 | // security level is available as of php 7.2.0 + openssl 1.1.0 according to the docs |
359 | - 'security_level' => min(1 + $version[1], 5), |
|
359 | + 'security_level' => min(1+$version[1], 5), |
|
360 | 360 | // capture_session_meta was deprecated in php 7.0 |
361 | 361 | //'capture_session_meta' => true, |
362 | 362 | )) |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | if (version_compare(PHP_VERSION, '8.0', '>=') && $this->args['SSLVERSION'] == 0) |
407 | 407 | { |
408 | 408 | $version = explode('.', PHP_VERSION); |
409 | - $this->client->setSSLVersion(min(4 + $version[1], 7)); |
|
409 | + $this->client->setSSLVersion(min(4+$version[1], 7)); |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | $this->$method(); |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | // this checks for a non-failed call |
623 | 623 | $time = microtime(true); |
624 | 624 | $this->send($m); |
625 | - $time = microtime(true) - $time; |
|
625 | + $time = microtime(true)-$time; |
|
626 | 626 | $this->assertGreaterThan(1.0, $time); |
627 | 627 | $this->assertLessThan(2.0, $time); |
628 | 628 | |
@@ -630,7 +630,7 @@ discard block |
||
630 | 630 | $m = new xmlrpcmsg('tests.sleep', array(new xmlrpcval(5, 'int'))); |
631 | 631 | $time = microtime(true); |
632 | 632 | $r = $this->send($m, array(0, PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['http_error'], PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['curl_fail'])); |
633 | - $time = microtime(true) - $time; |
|
633 | + $time = microtime(true)-$time; |
|
634 | 634 | $this->assertGreaterThan(2.0, $time); |
635 | 635 | $this->assertLessThan(4.0, $time); |
636 | 636 | |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | $this->addQueryParams(array('SLOW_LORIS' => 1)); |
651 | 651 | $time = microtime(true); |
652 | 652 | $this->send($m, array(0, PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['http_error'], PhpXmlRpc\PhpXmlRpc::$xmlrpcerr['curl_fail'])); |
653 | - $time = microtime(true) - $time; |
|
653 | + $time = microtime(true)-$time; |
|
654 | 654 | $this->assertGreaterThan(2.0, $time); |
655 | 655 | $this->assertLessThan(4.0, $time); |
656 | 656 | } |
@@ -337,10 +337,10 @@ discard block |
||
337 | 337 | $server = $parts['host']; |
338 | 338 | $path = isset($parts['path']) ? $parts['path'] : ''; |
339 | 339 | if (isset($parts['query'])) { |
340 | - $path .= '?' . $parts['query']; |
|
340 | + $path .= '?'.$parts['query']; |
|
341 | 341 | } |
342 | 342 | if (isset($parts['fragment'])) { |
343 | - $path .= '#' . $parts['fragment']; |
|
343 | + $path .= '#'.$parts['fragment']; |
|
344 | 344 | } |
345 | 345 | if (isset($parts['port'])) { |
346 | 346 | $port = $parts['port']; |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | } |
357 | 357 | } |
358 | 358 | if ($path == '' || $path[0] != '/') { |
359 | - $this->path = '/' . $path; |
|
359 | + $this->path = '/'.$path; |
|
360 | 360 | } else { |
361 | 361 | $this->path = $path; |
362 | 362 | } |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | //$this->accepted_charset_encodings = $ch->knownCharsets(); |
389 | 389 | |
390 | 390 | // initialize user_agent string |
391 | - $this->user_agent = PhpXmlRpc::$xmlrpcName . ' ' . PhpXmlRpc::$xmlrpcVersion; |
|
391 | + $this->user_agent = PhpXmlRpc::$xmlrpcName.' '.PhpXmlRpc::$xmlrpcVersion; |
|
392 | 392 | } |
393 | 393 | |
394 | 394 | /** |
@@ -560,7 +560,7 @@ discard block |
||
560 | 560 | */ |
561 | 561 | public function setSSLVerifyPeer($i) |
562 | 562 | { |
563 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
563 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
564 | 564 | |
565 | 565 | $this->verifypeer = $i; |
566 | 566 | return $this; |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | */ |
578 | 578 | public function setSSLVerifyHost($i) |
579 | 579 | { |
580 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
580 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
581 | 581 | |
582 | 582 | $this->verifyhost = $i; |
583 | 583 | return $this; |
@@ -594,7 +594,7 @@ discard block |
||
594 | 594 | */ |
595 | 595 | public function setSSLVersion($i) |
596 | 596 | { |
597 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
597 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
598 | 598 | |
599 | 599 | $this->sslversion = $i; |
600 | 600 | return $this; |
@@ -659,7 +659,7 @@ discard block |
||
659 | 659 | */ |
660 | 660 | public function setRequestCompression($compMethod) |
661 | 661 | { |
662 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
662 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
663 | 663 | |
664 | 664 | $this->request_compression = $compMethod; |
665 | 665 | return $this; |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | */ |
710 | 710 | public function setCurlOptions($options) |
711 | 711 | { |
712 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
712 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
713 | 713 | |
714 | 714 | $this->extracurlopts = $options; |
715 | 715 | return $this; |
@@ -722,7 +722,7 @@ discard block |
||
722 | 722 | */ |
723 | 723 | public function setUseCurl($useCurlMode) |
724 | 724 | { |
725 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
725 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
726 | 726 | |
727 | 727 | $this->use_curl = $useCurlMode; |
728 | 728 | return $this; |
@@ -740,7 +740,7 @@ discard block |
||
740 | 740 | */ |
741 | 741 | public function setUserAgent($agentString) |
742 | 742 | { |
743 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
743 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
744 | 744 | |
745 | 745 | $this->user_agent = $agentString; |
746 | 746 | return $this; |
@@ -772,12 +772,12 @@ discard block |
||
772 | 772 | } |
773 | 773 | } |
774 | 774 | |
775 | - $url = $this->method . '://' . $this->server; |
|
775 | + $url = $this->method.'://'.$this->server; |
|
776 | 776 | if ($this->port == 0 || ($this->port == 80 && in_array($this->method, array('http', 'http10', 'http11', 'h2c'))) || |
777 | 777 | ($this->port == 443 && in_array($this->method, array('https', 'h2')))) { |
778 | - return $url . $this->path; |
|
778 | + return $url.$this->path; |
|
779 | 779 | } else { |
780 | - return $url . ':' . $this->port . $this->path; |
|
780 | + return $url.':'.$this->port.$this->path; |
|
781 | 781 | } |
782 | 782 | } |
783 | 783 | |
@@ -820,7 +820,7 @@ discard block |
||
820 | 820 | public function send($req, $timeout = 0, $method = '') |
821 | 821 | { |
822 | 822 | if ($method !== '' || $timeout !== 0) { |
823 | - $this->logDeprecation("Using non-default values for arguments 'method' and 'timeout' when calling method " . __METHOD__ . ' is deprecated'); |
|
823 | + $this->logDeprecation("Using non-default values for arguments 'method' and 'timeout' when calling method ".__METHOD__.' is deprecated'); |
|
824 | 824 | } |
825 | 825 | |
826 | 826 | // if user does not specify http protocol, use native method of this client |
@@ -944,7 +944,7 @@ discard block |
||
944 | 944 | $payload = $a; |
945 | 945 | $encodingHdr = "Content-Encoding: gzip\r\n"; |
946 | 946 | } else { |
947 | - $this->getLogger()->warning('XML-RPC: ' . __METHOD__ . ': gzencode failure in compressing request'); |
|
947 | + $this->getLogger()->warning('XML-RPC: '.__METHOD__.': gzencode failure in compressing request'); |
|
948 | 948 | } |
949 | 949 | } else if (function_exists('gzcompress')) { |
950 | 950 | $a = @gzcompress($payload); |
@@ -952,14 +952,14 @@ discard block |
||
952 | 952 | $payload = $a; |
953 | 953 | $encodingHdr = "Content-Encoding: deflate\r\n"; |
954 | 954 | } else { |
955 | - $this->getLogger()->warning('XML-RPC: ' . __METHOD__ . ': gzcompress failure in compressing request'); |
|
955 | + $this->getLogger()->warning('XML-RPC: '.__METHOD__.': gzcompress failure in compressing request'); |
|
956 | 956 | } |
957 | 957 | } else { |
958 | - $this->getLogger()->warning('XML-RPC: ' . __METHOD__ . ': desired request compression method is unsupported by this PHP install'); |
|
958 | + $this->getLogger()->warning('XML-RPC: '.__METHOD__.': desired request compression method is unsupported by this PHP install'); |
|
959 | 959 | } |
960 | 960 | } else { |
961 | 961 | if ($opts['request_compression'] != '') { |
962 | - $this->getLogger()->warning('XML-RPC: ' . __METHOD__ . ': desired request compression method is unsupported'); |
|
962 | + $this->getLogger()->warning('XML-RPC: '.__METHOD__.': desired request compression method is unsupported'); |
|
963 | 963 | } |
964 | 964 | } |
965 | 965 | |
@@ -967,16 +967,16 @@ discard block |
||
967 | 967 | $credentials = ''; |
968 | 968 | if ($opts['username'] != '') { |
969 | 969 | if ($opts['authtype'] != 1) { |
970 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth is supported with HTTP 1.0'); |
|
970 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. Only Basic auth is supported with HTTP 1.0'); |
|
971 | 971 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['unsupported_option'], |
972 | - PhpXmlRpc::$xmlrpcerr['unsupported_option'] . ': only Basic auth is supported with HTTP 1.0'); |
|
972 | + PhpXmlRpc::$xmlrpcerr['unsupported_option'].': only Basic auth is supported with HTTP 1.0'); |
|
973 | 973 | } |
974 | - $credentials = 'Authorization: Basic ' . base64_encode($opts['username'] . ':' . $opts['password']) . "\r\n"; |
|
974 | + $credentials = 'Authorization: Basic '.base64_encode($opts['username'].':'.$opts['password'])."\r\n"; |
|
975 | 975 | } |
976 | 976 | |
977 | 977 | $acceptedEncoding = ''; |
978 | 978 | if (is_array($opts['accepted_compression']) && count($opts['accepted_compression'])) { |
979 | - $acceptedEncoding = 'Accept-Encoding: ' . implode(', ', $opts['accepted_compression']) . "\r\n"; |
|
979 | + $acceptedEncoding = 'Accept-Encoding: '.implode(', ', $opts['accepted_compression'])."\r\n"; |
|
980 | 980 | } |
981 | 981 | |
982 | 982 | if ($port == 0) { |
@@ -997,21 +997,21 @@ discard block |
||
997 | 997 | } elseif ($method === 'h2') { |
998 | 998 | $protocol = 'https'; |
999 | 999 | } else if (strpos($protocol, ':') !== false) { |
1000 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ": warning - attempted hacking attempt?. The protocol requested for the call is: '$protocol'"); |
|
1001 | - return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['unsupported_option'], PhpXmlRpc::$xmlrpcerr['unsupported_option'] . |
|
1000 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.": warning - attempted hacking attempt?. The protocol requested for the call is: '$protocol'"); |
|
1001 | + return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['unsupported_option'], PhpXmlRpc::$xmlrpcerr['unsupported_option']. |
|
1002 | 1002 | " attempted hacking attempt?. The protocol requested for the call is: '$protocol'"); |
1003 | 1003 | } |
1004 | 1004 | /// @todo this does not work atm (tested at least with an http proxy forwarding to an https server) - we |
1005 | 1005 | /// should implement the CONNECT protocol |
1006 | - $uri = $protocol . '://' . $server . ':' . $port . $path; |
|
1006 | + $uri = $protocol.'://'.$server.':'.$port.$path; |
|
1007 | 1007 | if ($opts['proxy_user'] != '') { |
1008 | 1008 | if ($opts['proxy_authtype'] != 1) { |
1009 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth to proxy is supported with HTTP 1.0'); |
|
1009 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. Only Basic auth to proxy is supported with HTTP 1.0'); |
|
1010 | 1010 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['unsupported_option'], |
1011 | - PhpXmlRpc::$xmlrpcerr['unsupported_option'] . ': only Basic auth to proxy is supported with socket transport'); |
|
1011 | + PhpXmlRpc::$xmlrpcerr['unsupported_option'].': only Basic auth to proxy is supported with socket transport'); |
|
1012 | 1012 | } |
1013 | - $proxyCredentials = 'Proxy-Authorization: Basic ' . base64_encode($opts['proxy_user'] . ':' . |
|
1014 | - $opts['proxy_pass']) . "\r\n"; |
|
1013 | + $proxyCredentials = 'Proxy-Authorization: Basic '.base64_encode($opts['proxy_user'].':'. |
|
1014 | + $opts['proxy_pass'])."\r\n"; |
|
1015 | 1015 | } |
1016 | 1016 | } else { |
1017 | 1017 | $connectServer = $server; |
@@ -1028,14 +1028,14 @@ discard block |
||
1028 | 1028 | $version = ''; |
1029 | 1029 | foreach ($opts['cookies'] as $name => $cookie) { |
1030 | 1030 | /// @todo should we sanitize the cookie value on behalf of the user? See setCookie comments |
1031 | - $cookieHeader .= ' ' . $name . '=' . $cookie['value'] . ";"; |
|
1031 | + $cookieHeader .= ' '.$name.'='.$cookie['value'].";"; |
|
1032 | 1032 | } |
1033 | - $cookieHeader = 'Cookie:' . $version . substr($cookieHeader, 0, -1) . "\r\n"; |
|
1033 | + $cookieHeader = 'Cookie:'.$version.substr($cookieHeader, 0, -1)."\r\n"; |
|
1034 | 1034 | } |
1035 | 1035 | |
1036 | 1036 | $extraHeaders = ''; |
1037 | 1037 | if (is_array($this->extra_headers) && $this->extra_headers) { |
1038 | - $extraHeaders = implode("\r\n", $this->extra_headers) . "\r\n"; |
|
1038 | + $extraHeaders = implode("\r\n", $this->extra_headers)."\r\n"; |
|
1039 | 1039 | } |
1040 | 1040 | |
1041 | 1041 | // omit port if default |
@@ -1043,24 +1043,24 @@ discard block |
||
1043 | 1043 | if (($port == 80 && in_array($method, array('http', 'http10', 'http11'))) || ($port == 443 && $method == 'https')) { |
1044 | 1044 | $port = ''; |
1045 | 1045 | } else { |
1046 | - $port = ':' . $port; |
|
1047 | - } |
|
1048 | - |
|
1049 | - $op = 'POST ' . $uri . " HTTP/1.0\r\n" . |
|
1050 | - 'User-Agent: ' . $opts['user_agent'] . "\r\n" . |
|
1051 | - 'Host: ' . $server . $port . "\r\n" . |
|
1052 | - $credentials . |
|
1053 | - $proxyCredentials . |
|
1054 | - $acceptedEncoding . |
|
1055 | - $encodingHdr . |
|
1056 | - 'Accept-Charset: ' . implode(',', $opts['accepted_charset_encodings']) . "\r\n" . |
|
1057 | - $cookieHeader . |
|
1058 | - 'Content-Type: ' . $req->getContentType() . "\r\n" . |
|
1059 | - $extraHeaders . |
|
1060 | - 'Content-Length: ' . strlen($payload) . "\r\n\r\n" . |
|
1046 | + $port = ':'.$port; |
|
1047 | + } |
|
1048 | + |
|
1049 | + $op = 'POST '.$uri." HTTP/1.0\r\n". |
|
1050 | + 'User-Agent: '.$opts['user_agent']."\r\n". |
|
1051 | + 'Host: '.$server.$port."\r\n". |
|
1052 | + $credentials. |
|
1053 | + $proxyCredentials. |
|
1054 | + $acceptedEncoding. |
|
1055 | + $encodingHdr. |
|
1056 | + 'Accept-Charset: '.implode(',', $opts['accepted_charset_encodings'])."\r\n". |
|
1057 | + $cookieHeader. |
|
1058 | + 'Content-Type: '.$req->getContentType()."\r\n". |
|
1059 | + $extraHeaders. |
|
1060 | + 'Content-Length: '.strlen($payload)."\r\n\r\n". |
|
1061 | 1061 | $payload; |
1062 | 1062 | |
1063 | - if ($opts['debug'] > 1) { |
|
1063 | + if ($opts['debug']>1) { |
|
1064 | 1064 | $this->getLogger()->debug("---SENDING---\n$op\n---END---"); |
1065 | 1065 | } |
1066 | 1066 | |
@@ -1089,13 +1089,13 @@ discard block |
||
1089 | 1089 | /// https://www.php.net/manual/en/function.stream-socket-enable-crypto.php |
1090 | 1090 | /// https://www.php.net/manual/en/migration56.openssl.php, |
1091 | 1091 | /// https://wiki.php.net/rfc/improved-tls-constants |
1092 | - switch($opts['sslversion']) { |
|
1092 | + switch ($opts['sslversion']) { |
|
1093 | 1093 | case 1: // TLSv1x |
1094 | 1094 | if (version_compare(PHP_VERSION, '7.2.0', '>=')) { |
1095 | 1095 | $contextOptions['ssl']['crypto_method'] = STREAM_CRYPTO_METHOD_TLS_CLIENT; |
1096 | 1096 | } else { |
1097 | 1097 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['unsupported_option'], |
1098 | - PhpXmlRpc::$xmlrpcerr['unsupported_option'] . ': TLS-any only is supported with PHP 7.2 or later'); |
|
1098 | + PhpXmlRpc::$xmlrpcerr['unsupported_option'].': TLS-any only is supported with PHP 7.2 or later'); |
|
1099 | 1099 | } |
1100 | 1100 | break; |
1101 | 1101 | case 2: // SSLv2 |
@@ -1118,12 +1118,12 @@ discard block |
||
1118 | 1118 | $contextOptions['ssl']['crypto_method'] = STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT; |
1119 | 1119 | } else { |
1120 | 1120 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['unsupported_option'], |
1121 | - PhpXmlRpc::$xmlrpcerr['unsupported_option'] . ': TLS-1.3 only is supported with PHP 7.4 or later'); |
|
1121 | + PhpXmlRpc::$xmlrpcerr['unsupported_option'].': TLS-1.3 only is supported with PHP 7.4 or later'); |
|
1122 | 1122 | } |
1123 | 1123 | break; |
1124 | 1124 | default: |
1125 | 1125 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['unsupported_option'], |
1126 | - PhpXmlRpc::$xmlrpcerr['unsupported_option'] . ': Unsupported required TLS version'); |
|
1126 | + PhpXmlRpc::$xmlrpcerr['unsupported_option'].': Unsupported required TLS version'); |
|
1127 | 1127 | } |
1128 | 1128 | } |
1129 | 1129 | } |
@@ -1136,7 +1136,7 @@ discard block |
||
1136 | 1136 | |
1137 | 1137 | $context = stream_context_create($contextOptions); |
1138 | 1138 | |
1139 | - if ($opts['timeout'] <= 0) { |
|
1139 | + if ($opts['timeout']<=0) { |
|
1140 | 1140 | $connectTimeout = ini_get('default_socket_timeout'); |
1141 | 1141 | } else { |
1142 | 1142 | $connectTimeout = $opts['timeout']; |
@@ -1155,7 +1155,7 @@ discard block |
||
1155 | 1155 | $fp = @stream_socket_client("$transport://$connectServer:$connectPort", $this->errno, $this->errstr, $connectTimeout, |
1156 | 1156 | STREAM_CLIENT_CONNECT, $context); |
1157 | 1157 | if ($fp) { |
1158 | - if ($opts['timeout'] > 0) { |
|
1158 | + if ($opts['timeout']>0) { |
|
1159 | 1159 | stream_set_timeout($fp, $opts['timeout'], 0); |
1160 | 1160 | } |
1161 | 1161 | } else { |
@@ -1164,8 +1164,8 @@ discard block |
||
1164 | 1164 | $this->errstr = $err['message']; |
1165 | 1165 | } |
1166 | 1166 | |
1167 | - $this->errstr = 'Connect error: ' . $this->errstr; |
|
1168 | - return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['http_error'], $this->errstr . ' (' . $this->errno . ')'); |
|
1167 | + $this->errstr = 'Connect error: '.$this->errstr; |
|
1168 | + return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['http_error'], $this->errstr.' ('.$this->errno.')'); |
|
1169 | 1169 | } |
1170 | 1170 | |
1171 | 1171 | if (!fputs($fp, $op, strlen($op))) { |
@@ -1245,19 +1245,19 @@ discard block |
||
1245 | 1245 | $opts['keepalive'], $opts['key'], $opts['keypass'], $opts['sslversion']); |
1246 | 1246 | |
1247 | 1247 | if (!$curl) { |
1248 | - return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'] . |
|
1248 | + return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail']. |
|
1249 | 1249 | ': error during curl initialization. Check php error log for details'); |
1250 | 1250 | } |
1251 | 1251 | |
1252 | 1252 | $result = curl_exec($curl); |
1253 | 1253 | |
1254 | - if ($opts['debug'] > 1) { |
|
1254 | + if ($opts['debug']>1) { |
|
1255 | 1255 | $message = "---CURL INFO---\n"; |
1256 | 1256 | foreach (curl_getinfo($curl) as $name => $val) { |
1257 | 1257 | if (is_array($val)) { |
1258 | 1258 | $val = implode("\n", $val); |
1259 | 1259 | } |
1260 | - $message .= $name . ': ' . $val . "\n"; |
|
1260 | + $message .= $name.': '.$val."\n"; |
|
1261 | 1261 | } |
1262 | 1262 | $message .= '---END---'; |
1263 | 1263 | $this->getLogger()->debug($message); |
@@ -1267,8 +1267,8 @@ discard block |
||
1267 | 1267 | /// @todo we should use a better check here - what if we get back '' or '0'? |
1268 | 1268 | |
1269 | 1269 | $this->errstr = 'no response'; |
1270 | - $resp = new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'] . |
|
1271 | - ': ' . curl_error($curl)); |
|
1270 | + $resp = new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail']. |
|
1271 | + ': '.curl_error($curl)); |
|
1272 | 1272 | curl_close($curl); |
1273 | 1273 | if ($opts['keepalive']) { |
1274 | 1274 | $this->xmlrpc_curl_handle = null; |
@@ -1326,7 +1326,7 @@ discard block |
||
1326 | 1326 | $payload = $a; |
1327 | 1327 | $encodingHdr = 'Content-Encoding: gzip'; |
1328 | 1328 | } else { |
1329 | - $this->getLogger()->warning('XML-RPC: ' . __METHOD__ . ': gzencode failure in compressing request'); |
|
1329 | + $this->getLogger()->warning('XML-RPC: '.__METHOD__.': gzencode failure in compressing request'); |
|
1330 | 1330 | } |
1331 | 1331 | } else if (function_exists('gzcompress')) { |
1332 | 1332 | $a = @gzcompress($payload); |
@@ -1334,14 +1334,14 @@ discard block |
||
1334 | 1334 | $payload = $a; |
1335 | 1335 | $encodingHdr = 'Content-Encoding: deflate'; |
1336 | 1336 | } else { |
1337 | - $this->getLogger()->warning('XML-RPC: ' . __METHOD__ . ': gzcompress failure in compressing request'); |
|
1337 | + $this->getLogger()->warning('XML-RPC: '.__METHOD__.': gzcompress failure in compressing request'); |
|
1338 | 1338 | } |
1339 | 1339 | } else { |
1340 | - $this->getLogger()->warning('XML-RPC: ' . __METHOD__ . ': desired request compression method is unsupported by this PHP install'); |
|
1340 | + $this->getLogger()->warning('XML-RPC: '.__METHOD__.': desired request compression method is unsupported by this PHP install'); |
|
1341 | 1341 | } |
1342 | 1342 | } else { |
1343 | 1343 | if ($opts['request_compression'] != '') { |
1344 | - $this->getLogger()->warning('XML-RPC: ' . __METHOD__ . ': desired request compression method is unsupported'); |
|
1344 | + $this->getLogger()->warning('XML-RPC: '.__METHOD__.': desired request compression method is unsupported'); |
|
1345 | 1345 | } |
1346 | 1346 | } |
1347 | 1347 | |
@@ -1355,12 +1355,12 @@ discard block |
||
1355 | 1355 | // http, https |
1356 | 1356 | $protocol = $method; |
1357 | 1357 | if (strpos($protocol, ':') !== false) { |
1358 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ": warning - attempted hacking attempt?. The curl protocol requested for the call is: '$protocol'"); |
|
1358 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.": warning - attempted hacking attempt?. The curl protocol requested for the call is: '$protocol'"); |
|
1359 | 1359 | return false; |
1360 | 1360 | } |
1361 | 1361 | } |
1362 | 1362 | } |
1363 | - $curl = curl_init($protocol . '://' . $server . ':' . $port . $path); |
|
1363 | + $curl = curl_init($protocol.'://'.$server.':'.$port.$path); |
|
1364 | 1364 | if (!$curl) { |
1365 | 1365 | return false; |
1366 | 1366 | } |
@@ -1374,7 +1374,7 @@ discard block |
||
1374 | 1374 | // results into variable |
1375 | 1375 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); |
1376 | 1376 | |
1377 | - if ($opts['debug'] > 1) { |
|
1377 | + if ($opts['debug']>1) { |
|
1378 | 1378 | curl_setopt($curl, CURLOPT_VERBOSE, true); |
1379 | 1379 | /// @todo redirect curlopt_stderr to some stream which can be piped to the logger |
1380 | 1380 | } |
@@ -1399,7 +1399,7 @@ discard block |
||
1399 | 1399 | } |
1400 | 1400 | } |
1401 | 1401 | // extra headers |
1402 | - $headers = array('Content-Type: ' . $req->getContentType(), 'Accept-Charset: ' . implode(',', $opts['accepted_charset_encodings'])); |
|
1402 | + $headers = array('Content-Type: '.$req->getContentType(), 'Accept-Charset: '.implode(',', $opts['accepted_charset_encodings'])); |
|
1403 | 1403 | // if no keepalive is wanted, let the server know it in advance |
1404 | 1404 | if (!$opts['keepalive']) { |
1405 | 1405 | $headers[] = 'Connection: close'; |
@@ -1435,7 +1435,7 @@ discard block |
||
1435 | 1435 | if (defined('CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE')) { |
1436 | 1436 | curl_setopt($curl, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_PRIOR_KNOWLEDGE); |
1437 | 1437 | } else { |
1438 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. HTTP2 is not supported by the current PHP/curl install'); |
|
1438 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. HTTP2 is not supported by the current PHP/curl install'); |
|
1439 | 1439 | curl_close($curl); |
1440 | 1440 | return false; |
1441 | 1441 | } |
@@ -1446,11 +1446,11 @@ discard block |
||
1446 | 1446 | } |
1447 | 1447 | |
1448 | 1448 | if ($opts['username'] && $opts['password']) { |
1449 | - curl_setopt($curl, CURLOPT_USERPWD, $opts['username'] . ':' . $opts['password']); |
|
1449 | + curl_setopt($curl, CURLOPT_USERPWD, $opts['username'].':'.$opts['password']); |
|
1450 | 1450 | if (defined('CURLOPT_HTTPAUTH')) { |
1451 | 1451 | curl_setopt($curl, CURLOPT_HTTPAUTH, $opts['authtype']); |
1452 | 1452 | } elseif ($opts['authtype'] != 1) { |
1453 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth is supported by the current PHP/curl install'); |
|
1453 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. Only Basic auth is supported by the current PHP/curl install'); |
|
1454 | 1454 | curl_close($curl); |
1455 | 1455 | return false; |
1456 | 1456 | } |
@@ -1495,13 +1495,13 @@ discard block |
||
1495 | 1495 | if ($opts['proxyport'] == 0) { |
1496 | 1496 | $opts['proxyport'] = 8080; // NB: even for HTTPS, local connection is on port 8080 |
1497 | 1497 | } |
1498 | - curl_setopt($curl, CURLOPT_PROXY, $opts['proxy'] . ':' . $opts['proxyport']); |
|
1498 | + curl_setopt($curl, CURLOPT_PROXY, $opts['proxy'].':'.$opts['proxyport']); |
|
1499 | 1499 | if ($opts['proxy_user']) { |
1500 | - curl_setopt($curl, CURLOPT_PROXYUSERPWD, $opts['proxy_user'] . ':' . $opts['proxy_pass']); |
|
1500 | + curl_setopt($curl, CURLOPT_PROXYUSERPWD, $opts['proxy_user'].':'.$opts['proxy_pass']); |
|
1501 | 1501 | if (defined('CURLOPT_PROXYAUTH')) { |
1502 | 1502 | curl_setopt($curl, CURLOPT_PROXYAUTH, $opts['proxy_authtype']); |
1503 | 1503 | } elseif ($opts['proxy_authtype'] != 1) { |
1504 | - $this->getLogger()->error('XML-RPC: ' . __METHOD__ . ': warning. Only Basic auth to proxy is supported by the current PHP/curl install'); |
|
1504 | + $this->getLogger()->error('XML-RPC: '.__METHOD__.': warning. Only Basic auth to proxy is supported by the current PHP/curl install'); |
|
1505 | 1505 | curl_close($curl); |
1506 | 1506 | return false; |
1507 | 1507 | } |
@@ -1513,7 +1513,7 @@ discard block |
||
1513 | 1513 | if (count($opts['cookies'])) { |
1514 | 1514 | $cookieHeader = ''; |
1515 | 1515 | foreach ($opts['cookies'] as $name => $cookie) { |
1516 | - $cookieHeader .= $name . '=' . $cookie['value'] . '; '; |
|
1516 | + $cookieHeader .= $name.'='.$cookie['value'].'; '; |
|
1517 | 1517 | } |
1518 | 1518 | curl_setopt($curl, CURLOPT_COOKIE, substr($cookieHeader, 0, -2)); |
1519 | 1519 | } |
@@ -1522,7 +1522,7 @@ discard block |
||
1522 | 1522 | curl_setopt($curl, $opt, $val); |
1523 | 1523 | } |
1524 | 1524 | |
1525 | - if ($opts['debug'] > 1) { |
|
1525 | + if ($opts['debug']>1) { |
|
1526 | 1526 | $this->getLogger()->debug("---SENDING---\n$payload\n---END---"); |
1527 | 1527 | } |
1528 | 1528 | |
@@ -1623,7 +1623,7 @@ discard block |
||
1623 | 1623 | $call['methodName'] = new Value($req->method(), 'string'); |
1624 | 1624 | $numParams = $req->getNumParams(); |
1625 | 1625 | $params = array(); |
1626 | - for ($i = 0; $i < $numParams; $i++) { |
|
1626 | + for ($i = 0; $i<$numParams; $i++) { |
|
1627 | 1627 | $params[$i] = $req->getParam($i); |
1628 | 1628 | } |
1629 | 1629 | $call['params'] = new Value($params, 'array'); |
@@ -1645,7 +1645,7 @@ discard block |
||
1645 | 1645 | $response = array(); |
1646 | 1646 | |
1647 | 1647 | if ($this->return_type == 'xml') { |
1648 | - for ($i = 0; $i < count($reqs); $i++) { |
|
1648 | + for ($i = 0; $i<count($reqs); $i++) { |
|
1649 | 1649 | $response[] = new static::$responseClass($rets, 0, '', 'xml', $result->httpResponse()); |
1650 | 1650 | } |
1651 | 1651 | |
@@ -1653,21 +1653,21 @@ discard block |
||
1653 | 1653 | if (!is_array($rets)) { |
1654 | 1654 | // bad return type from system.multicall |
1655 | 1655 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1656 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ': not an array', 'phpvals', $result->httpResponse()); |
|
1656 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].': not an array', 'phpvals', $result->httpResponse()); |
|
1657 | 1657 | } |
1658 | 1658 | $numRets = count($rets); |
1659 | 1659 | if ($numRets != count($reqs)) { |
1660 | 1660 | // wrong number of return values. |
1661 | 1661 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1662 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ': incorrect number of responses', 'phpvals', |
|
1662 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].': incorrect number of responses', 'phpvals', |
|
1663 | 1663 | $result->httpResponse()); |
1664 | 1664 | } |
1665 | 1665 | |
1666 | - for ($i = 0; $i < $numRets; $i++) { |
|
1666 | + for ($i = 0; $i<$numRets; $i++) { |
|
1667 | 1667 | $val = $rets[$i]; |
1668 | 1668 | if (!is_array($val)) { |
1669 | 1669 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1670 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i is not an array or struct", |
|
1670 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i is not an array or struct", |
|
1671 | 1671 | 'phpvals', $result->httpResponse()); |
1672 | 1672 | } |
1673 | 1673 | switch (count($val)) { |
@@ -1675,7 +1675,7 @@ discard block |
||
1675 | 1675 | if (!isset($val[0])) { |
1676 | 1676 | // Bad value |
1677 | 1677 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1678 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has no value", |
|
1678 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has no value", |
|
1679 | 1679 | 'phpvals', $result->httpResponse()); |
1680 | 1680 | } |
1681 | 1681 | // Normal return value |
@@ -1687,20 +1687,20 @@ discard block |
||
1687 | 1687 | if (!is_int($code)) { |
1688 | 1688 | /// @todo should we check that it is != 0? |
1689 | 1689 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1690 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has invalid or no faultCode", |
|
1690 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has invalid or no faultCode", |
|
1691 | 1691 | 'phpvals', $result->httpResponse()); |
1692 | 1692 | } |
1693 | 1693 | $str = @$val['faultString']; |
1694 | 1694 | if (!is_string($str)) { |
1695 | 1695 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1696 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has invalid or no FaultString", |
|
1696 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has invalid or no FaultString", |
|
1697 | 1697 | 'phpvals', $result->httpResponse()); |
1698 | 1698 | } |
1699 | 1699 | $response[$i] = new static::$responseClass(0, $code, $str, 'phpvals', $result->httpResponse()); |
1700 | 1700 | break; |
1701 | 1701 | default: |
1702 | 1702 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1703 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has too many items", |
|
1703 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has too many items", |
|
1704 | 1704 | 'phpvals', $result->httpResponse()); |
1705 | 1705 | } |
1706 | 1706 | } |
@@ -1709,14 +1709,14 @@ discard block |
||
1709 | 1709 | // return type == 'xmlrpcvals' |
1710 | 1710 | if ($rets->kindOf() != 'array') { |
1711 | 1711 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1712 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i is not an array", 'xmlrpcvals', |
|
1712 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i is not an array", 'xmlrpcvals', |
|
1713 | 1713 | $result->httpResponse()); |
1714 | 1714 | } |
1715 | 1715 | $numRets = $rets->count(); |
1716 | 1716 | if ($numRets != count($reqs)) { |
1717 | 1717 | // wrong number of return values. |
1718 | 1718 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1719 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ': incorrect number of responses', 'xmlrpcvals', |
|
1719 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].': incorrect number of responses', 'xmlrpcvals', |
|
1720 | 1720 | $result->httpResponse()); |
1721 | 1721 | } |
1722 | 1722 | |
@@ -1725,7 +1725,7 @@ discard block |
||
1725 | 1725 | case 'array': |
1726 | 1726 | if ($val->count() != 1) { |
1727 | 1727 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1728 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has too many items", |
|
1728 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has too many items", |
|
1729 | 1729 | 'phpvals', $result->httpResponse()); |
1730 | 1730 | } |
1731 | 1731 | // Normal return value |
@@ -1734,28 +1734,28 @@ discard block |
||
1734 | 1734 | case 'struct': |
1735 | 1735 | if ($val->count() != 2) { |
1736 | 1736 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1737 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has too many items", |
|
1737 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has too many items", |
|
1738 | 1738 | 'phpvals', $result->httpResponse()); |
1739 | 1739 | } |
1740 | 1740 | /** @var Value $code */ |
1741 | 1741 | $code = $val['faultCode']; |
1742 | 1742 | if ($code->kindOf() != 'scalar' || $code->scalarTyp() != 'int') { |
1743 | 1743 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1744 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has invalid or no faultCode", |
|
1744 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has invalid or no faultCode", |
|
1745 | 1745 | 'xmlrpcvals', $result->httpResponse()); |
1746 | 1746 | } |
1747 | 1747 | /** @var Value $str */ |
1748 | 1748 | $str = $val['faultString']; |
1749 | 1749 | if ($str->kindOf() != 'scalar' || $str->scalarTyp() != 'string') { |
1750 | 1750 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1751 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i has invalid or no faultCode", |
|
1751 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i has invalid or no faultCode", |
|
1752 | 1752 | 'xmlrpcvals', $result->httpResponse()); |
1753 | 1753 | } |
1754 | 1754 | $response[] = new static::$responseClass(0, $code->scalarVal(), $str->scalarVal(), 'xmlrpcvals', $result->httpResponse()); |
1755 | 1755 | break; |
1756 | 1756 | default: |
1757 | 1757 | return new static::$responseClass(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], |
1758 | - PhpXmlRpc::$xmlrpcstr['multicall_error'] . ": response element $i is not an array or struct", |
|
1758 | + PhpXmlRpc::$xmlrpcstr['multicall_error'].": response element $i is not an array or struct", |
|
1759 | 1759 | 'xmlrpcvals', $result->httpResponse()); |
1760 | 1760 | } |
1761 | 1761 | } |
@@ -1790,7 +1790,7 @@ discard block |
||
1790 | 1790 | $authType = 1, $proxyHost = '', $proxyPort = 0, $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, |
1791 | 1791 | $method = 'http') |
1792 | 1792 | { |
1793 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
1793 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
1794 | 1794 | |
1795 | 1795 | return $this->sendPayloadSocket($req, $server, $port, $timeout, $username, $password, $authType, null, null, |
1796 | 1796 | null, null, $proxyHost, $proxyPort, $proxyUsername, $proxyPassword, $proxyAuthType, $method); |
@@ -1828,7 +1828,7 @@ discard block |
||
1828 | 1828 | $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, $keepAlive = false, $key = '', $keyPass = '', |
1829 | 1829 | $sslVersion = 0) |
1830 | 1830 | { |
1831 | - $this->logDeprecation('Method ' . __METHOD__ . ' is deprecated'); |
|
1831 | + $this->logDeprecation('Method '.__METHOD__.' is deprecated'); |
|
1832 | 1832 | |
1833 | 1833 | return $this->sendPayloadCURL($req, $server, $port, $timeout, $username, |
1834 | 1834 | $password, $authType, $cert, $certPass, $caCert, $caCertDir, $proxyHost, $proxyPort, |
@@ -2041,7 +2041,7 @@ discard block |
||
2041 | 2041 | public function &__get($name) |
2042 | 2042 | { |
2043 | 2043 | if (in_array($name, static::$options)) { |
2044 | - $this->logDeprecation('Getting property Client::' . $name . ' is deprecated'); |
|
2044 | + $this->logDeprecation('Getting property Client::'.$name.' is deprecated'); |
|
2045 | 2045 | return $this->$name; |
2046 | 2046 | } |
2047 | 2047 | |
@@ -2052,12 +2052,12 @@ discard block |
||
2052 | 2052 | case 'server': |
2053 | 2053 | case 'port': |
2054 | 2054 | case 'path': |
2055 | - $this->logDeprecation('Getting property Client::' . $name . ' is deprecated'); |
|
2055 | + $this->logDeprecation('Getting property Client::'.$name.' is deprecated'); |
|
2056 | 2056 | return $this->$name; |
2057 | 2057 | default: |
2058 | 2058 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... |
2059 | 2059 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); |
2060 | - trigger_error('Undefined property via __get(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
2060 | + trigger_error('Undefined property via __get(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
2061 | 2061 | $result = null; |
2062 | 2062 | return $result; |
2063 | 2063 | } |
@@ -2066,7 +2066,7 @@ discard block |
||
2066 | 2066 | public function __set($name, $value) |
2067 | 2067 | { |
2068 | 2068 | if (in_array($name, static::$options)) { |
2069 | - $this->logDeprecation('Setting property Client::' . $name . ' is deprecated'); |
|
2069 | + $this->logDeprecation('Setting property Client::'.$name.' is deprecated'); |
|
2070 | 2070 | $this->$name = $value; |
2071 | 2071 | return; |
2072 | 2072 | } |
@@ -2078,20 +2078,20 @@ discard block |
||
2078 | 2078 | case 'server': |
2079 | 2079 | case 'port': |
2080 | 2080 | case 'path': |
2081 | - $this->logDeprecation('Setting property Client::' . $name . ' is deprecated'); |
|
2081 | + $this->logDeprecation('Setting property Client::'.$name.' is deprecated'); |
|
2082 | 2082 | $this->$name = $value; |
2083 | 2083 | return; |
2084 | 2084 | default: |
2085 | 2085 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... |
2086 | 2086 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); |
2087 | - trigger_error('Undefined property via __set(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
2087 | + trigger_error('Undefined property via __set(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
2088 | 2088 | } |
2089 | 2089 | } |
2090 | 2090 | |
2091 | 2091 | public function __isset($name) |
2092 | 2092 | { |
2093 | 2093 | if (in_array($name, static::$options)) { |
2094 | - $this->logDeprecation('Checking property Client::' . $name . ' is deprecated'); |
|
2094 | + $this->logDeprecation('Checking property Client::'.$name.' is deprecated'); |
|
2095 | 2095 | return isset($this->$name); |
2096 | 2096 | } |
2097 | 2097 | |
@@ -2102,7 +2102,7 @@ discard block |
||
2102 | 2102 | case 'server': |
2103 | 2103 | case 'port': |
2104 | 2104 | case 'path': |
2105 | - $this->logDeprecation('Checking property Client::' . $name . ' is deprecated'); |
|
2105 | + $this->logDeprecation('Checking property Client::'.$name.' is deprecated'); |
|
2106 | 2106 | return isset($this->$name); |
2107 | 2107 | default: |
2108 | 2108 | return false; |
@@ -2112,7 +2112,7 @@ discard block |
||
2112 | 2112 | public function __unset($name) |
2113 | 2113 | { |
2114 | 2114 | if (in_array($name, static::$options)) { |
2115 | - $this->logDeprecation('Unsetting property Client::' . $name . ' is deprecated'); |
|
2115 | + $this->logDeprecation('Unsetting property Client::'.$name.' is deprecated'); |
|
2116 | 2116 | unset($this->$name); |
2117 | 2117 | return; |
2118 | 2118 | } |
@@ -2124,13 +2124,13 @@ discard block |
||
2124 | 2124 | case 'server': |
2125 | 2125 | case 'port': |
2126 | 2126 | case 'path': |
2127 | - $this->logDeprecation('Unsetting property Client::' . $name . ' is deprecated'); |
|
2127 | + $this->logDeprecation('Unsetting property Client::'.$name.' is deprecated'); |
|
2128 | 2128 | unset($this->$name); |
2129 | 2129 | return; |
2130 | 2130 | default: |
2131 | 2131 | /// @todo throw instead? There are very few other places where the lib trigger errors which can potentially reach stdout... |
2132 | 2132 | $trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 1); |
2133 | - trigger_error('Undefined property via __unset(): ' . $name . ' in ' . $trace[0]['file'] . ' on line ' . $trace[0]['line'], E_USER_WARNING); |
|
2133 | + trigger_error('Undefined property via __unset(): '.$name.' in '.$trace[0]['file'].' on line '.$trace[0]['line'], E_USER_WARNING); |
|
2134 | 2134 | } |
2135 | 2135 | } |
2136 | 2136 | } |