fix test coverage calculations
[plcapi.git] / src / Encoder.php
index 22db3b9..f2bc88f 100644 (file)
@@ -2,6 +2,7 @@
 
 namespace PhpXmlRpc;
 
+use PhpXmlRpc\Helper\Logger;
 use PhpXmlRpc\Helper\XMLParser;
 
 /**
@@ -235,8 +236,11 @@ class Encoder
         $valEncoding = XMLParser::guessEncoding('', $xmlVal);
         if ($valEncoding != '') {
 
-            // Since parsing will fail if charset is not specified in the xml prologue,
-            // the encoding is not UTF8 and there are non-ascii chars in the text, we try to work round that...
+            // Since parsing will fail if
+            // - charset is not specified in the xml prologue,
+            // - the encoding is not UTF8 and
+            // - there are non-ascii chars in the text,
+            // we try to work round that...
             // The following code might be better for mb_string enabled installs, but makes the lib about 200% slower...
             //if (!is_valid_charset($valEncoding, array('UTF-8'))
             if (!in_array($valEncoding, array('UTF-8', 'US-ASCII')) && !XMLParser::hasEncoding($xmlVal)) {
@@ -246,7 +250,7 @@ class Encoder
                     if (extension_loaded('mbstring')) {
                         $xmlVal = mb_convert_encoding($xmlVal, 'UTF-8', $valEncoding);
                     } else {
-                        error_log('XML-RPC: ' . __METHOD__ . ': invalid charset encoding of xml text: ' . $valEncoding);
+                        Logger::instance()->errorLog('XML-RPC: ' . __METHOD__ . ': invalid charset encoding of xml text: ' . $valEncoding);
                     }
                 }
             }
@@ -265,7 +269,7 @@ class Encoder
         if ($xmlRpcParser->_xh['isf'] > 1) {
             // test that $xmlrpc->_xh['value'] is an obj, too???
 
-            error_log($xmlRpcParser->_xh['isf_reason']);
+            Logger::instance()->errorLog($xmlRpcParser->_xh['isf_reason']);
 
             return false;
         }