From 08eb8d3c32a0f24c2f37565bc1d06672b498ffd2 Mon Sep 17 00:00:00 2001 From: gggeek Date: Sat, 26 Nov 2022 14:52:20 +0000 Subject: [PATCH] whitespace --- src/Encoder.php | 4 ++-- src/Helper/Charset.php | 2 +- src/Helper/Http.php | 6 +++--- src/Helper/XMLParser.php | 2 +- src/Response.php | 8 ++++---- src/Server.php | 6 +++--- src/Wrapper.php | 6 +++--- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Encoder.php b/src/Encoder.php index b8cbc19c..9b1d2cea 100644 --- a/src/Encoder.php +++ b/src/Encoder.php @@ -116,7 +116,7 @@ class Encoder case 'array': $arr = array(); - foreach($xmlrpcVal as $value) { + foreach ($xmlrpcVal as $value) { $arr[] = $this->decode($value, $options); } return $arr; @@ -240,7 +240,7 @@ class Encoder } else { $arr = array(); - foreach($phpVal as $k => $v) { + foreach ($phpVal as $k => $v) { $arr[$k] = $this->encode($v, $options); } $xmlrpcVal = new Value($arr, Value::$xmlrpcStruct); diff --git a/src/Helper/Charset.php b/src/Helper/Charset.php index 5fa54225..45cb3d34 100644 --- a/src/Helper/Charset.php +++ b/src/Helper/Charset.php @@ -63,7 +63,7 @@ class Charset */ protected function buildConversionTable($tableName) { - switch($tableName) { + switch ($tableName) { case 'xml_iso88591_Entities': if (count($this->xml_iso88591_Entities['in'])) { return; diff --git a/src/Helper/Http.php b/src/Helper/Http.php index 6583d064..370f6ed6 100644 --- a/src/Helper/Http.php +++ b/src/Helper/Http.php @@ -74,7 +74,7 @@ class Http * @todo if $debug is 0, we could avoid populating 'raw_data' and 'headers' in the returned value - even better, have * 2 debug levels */ - public function parseResponseHeaders(&$data, $headersProcessed = false, $debug=0) + public function parseResponseHeaders(&$data, $headersProcessed = false, $debug = 0) { $httpResponse = array('raw_data' => $data, 'headers'=> array(), 'cookies' => array(), 'status_code' => null); @@ -133,7 +133,7 @@ class Http if ($httpResponse['status_code'] !== '200') { $errstr = substr($data, 0, strpos($data, "\n") - 1); Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': HTTP error, got response: ' . $errstr); - throw new HttpException(PhpXmlRpc::$xmlrpcstr['http_error'] . ' (' . $errstr . ')', PhpXmlRpc::$xmlrpcerr['http_error'], null, $httpResponse['status_code'] ); + throw new HttpException(PhpXmlRpc::$xmlrpcstr['http_error'] . ' (' . $errstr . ')', PhpXmlRpc::$xmlrpcerr['http_error'], null, $httpResponse['status_code']); } // be tolerant to usage of \n instead of \r\n to separate headers and data @@ -155,7 +155,7 @@ class Http // be tolerant to line endings, and extra empty lines $ar = preg_split("/\r?\n/", trim(substr($data, 0, $pos))); - foreach($ar as $line) { + foreach ($ar as $line) { // take care of multi-line headers and cookies $arr = explode(':', $line, 2); if (count($arr) > 1) { diff --git a/src/Helper/XMLParser.php b/src/Helper/XMLParser.php index 8b0a357b..5fd75a1f 100644 --- a/src/Helper/XMLParser.php +++ b/src/Helper/XMLParser.php @@ -137,7 +137,7 @@ class XMLParser xml_set_object($parser, $this); - switch($returnType) { + switch ($returnType) { case self::RETURN_PHP: xml_set_element_handler($parser, 'xmlrpc_se', 'xmlrpc_ee_fast'); break; diff --git a/src/Response.php b/src/Response.php index aa703c24..d42bc2d1 100644 --- a/src/Response.php +++ b/src/Response.php @@ -195,7 +195,7 @@ class Response { //trigger_error('getting property Response::' . $name . ' is deprecated', E_USER_DEPRECATED); - switch($name) { + switch ($name) { case 'hdrs': return $this->httpResponse['headers']; case '_cookies': @@ -213,7 +213,7 @@ class Response { //trigger_error('setting property Response::' . $name . ' is deprecated', E_USER_DEPRECATED); - switch($name) { + switch ($name) { case 'hdrs': $this->httpResponse['headers'] = $value; break; @@ -231,7 +231,7 @@ class Response public function __isset($name) { - switch($name) { + switch ($name) { case 'hdrs': return isset($this->httpResponse['headers']); case '_cookies': @@ -245,7 +245,7 @@ class Response public function __unset($name) { - switch($name) { + switch ($name) { case 'hdrs': unset($this->httpResponse['headers']); break; diff --git a/src/Server.php b/src/Server.php index 1cc965f3..8a5cddb1 100644 --- a/src/Server.php +++ b/src/Server.php @@ -1063,7 +1063,7 @@ class Server } $req = new Request($methName->scalarval()); - foreach($params as $i => $param) { + foreach ($params as $i => $param) { if (!$req->addParam($param)) { $i++; // for error message, we count params from 1 return static::_xmlrpcs_multicall_error(new Response(0, @@ -1140,7 +1140,7 @@ class Server // let accept a plain list of php parameters, beside a single xmlrpc msg object if (is_object($req)) { $calls = $req->getParam(0); - foreach($calls as $call) { + foreach ($calls as $call) { $result[] = static::_xmlrpcs_multicall_do_call($server, $call); } } else { @@ -1168,7 +1168,7 @@ class Server return; } - //if($errCode != E_NOTICE && $errCode != E_WARNING && $errCode != E_USER_NOTICE && $errCode != E_USER_WARNING) + //if ($errCode != E_NOTICE && $errCode != E_WARNING && $errCode != E_USER_NOTICE && $errCode != E_USER_WARNING) if ($errCode != E_STRICT) { \PhpXmlRpc\Server::error_occurred($errString); } diff --git a/src/Wrapper.php b/src/Wrapper.php index 5e6ff513..ff976527 100644 --- a/src/Wrapper.php +++ b/src/Wrapper.php @@ -606,7 +606,7 @@ class Wrapper } } // shall we exclude functions returning by ref? - // if($func->returnsReference()) + // if ($func->returnsReference()) // return false; $code = "function $newFuncName(\$req) {\n" . $innerCode . "\n}"; @@ -877,7 +877,7 @@ class Wrapper } $xmlrpcArgs = array(); - foreach($currentArgs as $i => $arg) { + foreach ($currentArgs as $i => $arg) { if ($i == $maxArgs) { break; } @@ -1135,7 +1135,7 @@ class Wrapper * * @return string */ - protected function buildClientWrapperCode($client, $verbatimClientCopy, $prefix = 'xmlrpc', $namespace = '\\PhpXmlRpc\\' ) + protected function buildClientWrapperCode($client, $verbatimClientCopy, $prefix = 'xmlrpc', $namespace = '\\PhpXmlRpc\\') { $code = "\$client = new {$namespace}Client('" . str_replace("'", "\'", $client->path) . "', '" . str_replace("'", "\'", $client->server) . "', $client->port);\n"; -- 2.47.0