Code Duplication    Length = 5-5 lines in 3 locations

src/Encoder.php 1 location

@@ 256-260 (lines=5) @@
253
        }
254
255
        // What if internal encoding is not in one of the 3 allowed? We use the broadest one, ie. utf8!
256
        if (!in_array(PhpXmlRpc::$xmlrpc_internalencoding, array('UTF-8', 'ISO-8859-1', 'US-ASCII'))) {
257
            $options = array(XML_OPTION_TARGET_ENCODING => 'UTF-8');
258
        } else {
259
            $options = array(XML_OPTION_TARGET_ENCODING => PhpXmlRpc::$xmlrpc_internalencoding);
260
        }
261
262
        $xmlRpcParser = new XMLParser($options);
263
        $xmlRpcParser->parse($xmlVal, XMLParser::RETURN_XMLRPCVALS, XMLParser::ACCEPT_REQUEST | XMLParser::ACCEPT_RESPONSE | XMLParser::ACCEPT_VALUE);

src/Request.php 1 location

@@ 267-271 (lines=5) @@
264
        // What if internal encoding is not in one of the 3 allowed? We use the broadest one, ie. utf8
265
        // This allows to send data which is native in various charset, by extending xmlrpc_encode_entities() and
266
        // setting xmlrpc_internalencoding
267
        if (!in_array(PhpXmlRpc::$xmlrpc_internalencoding, array('UTF-8', 'ISO-8859-1', 'US-ASCII'))) {
268
            $options = array(XML_OPTION_TARGET_ENCODING => 'UTF-8');
269
        } else {
270
            $options = array(XML_OPTION_TARGET_ENCODING => PhpXmlRpc::$xmlrpc_internalencoding);
271
        }
272
273
        $xmlRpcParser = new XMLParser($options);
274
        $xmlRpcParser->parse($data, $returnType, XMLParser::ACCEPT_RESPONSE);

src/Server.php 1 location

@@ 498-502 (lines=5) @@
495
        // What if internal encoding is not in one of the 3 allowed? We use the broadest one, ie. utf8
496
        // This allows to send data which is native in various charset,
497
        // by extending xmlrpc_encode_entities() and setting xmlrpc_internalencoding
498
        if (!in_array(PhpXmlRpc::$xmlrpc_internalencoding, array('UTF-8', 'ISO-8859-1', 'US-ASCII'))) {
499
            $options = array(XML_OPTION_TARGET_ENCODING => 'UTF-8');
500
        } else {
501
            $options = array(XML_OPTION_TARGET_ENCODING => PhpXmlRpc::$xmlrpc_internalencoding);
502
        }
503
504
        $xmlRpcParser = new XMLParser($options);
505
        $xmlRpcParser->parse($data, $this->functions_parameters_type, XMLParser::ACCEPT_REQUEST);