whitespace
authorgggeek <giunta.gaetano@gmail.com>
Sat, 26 Nov 2022 14:52:20 +0000 (14:52 +0000)
committergggeek <giunta.gaetano@gmail.com>
Sat, 26 Nov 2022 14:52:20 +0000 (14:52 +0000)
src/Encoder.php
src/Helper/Charset.php
src/Helper/Http.php
src/Helper/XMLParser.php
src/Response.php
src/Server.php
src/Wrapper.php

index b8cbc19..9b1d2ce 100644 (file)
@@ -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);
index 5fa5422..45cb3d3 100644 (file)
@@ -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;
index 6583d06..370f6ed 100644 (file)
@@ -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) {
index 8b0a357..5fd75a1 100644 (file)
@@ -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;
index aa703c2..d42bc2d 100644 (file)
@@ -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;
index 1cc965f..8a5cddb 100644 (file)
@@ -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);
         }
index 5e6ff51..ff97652 100644 (file)
@@ -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";