Code Duplication    Length = 4-8 lines in 2 locations

src/Request.php 1 location

@@ 188-191 (lines=4) @@
185
186
        $this->httpResponse = array('raw_data' => $data, 'headers' => array(), 'cookies' => array());
187
188
        if ($data == '') {
189
            error_log('XML-RPC: ' . __METHOD__ . ': no response received from server.');
190
            return new Response(0, PhpXmlRpc::$xmlrpcerr['no_data'], PhpXmlRpc::$xmlrpcstr['no_data']);
191
        }
192
193
        // parse the HTTP headers of the response, if present, and separate them from data
194
        if (substr($data, 0, 4) == 'HTTP') {

src/Server.php 1 location

@@ 627-634 (lines=8) @@
624
        }
625
626
        // verify that function to be invoked is in fact callable
627
        if (!is_callable($func)) {
628
            error_log("XML-RPC: " . __METHOD__ . ": function '$funcName' registered as method handler is not callable");
629
            return new Response(
630
                0,
631
                PhpXmlRpc::$xmlrpcerr['server_error'],
632
                PhpXmlRpc::$xmlrpcstr['server_error'] . ": no function matches method"
633
            );
634
        }
635
636
        // If debug level is 3, we should catch all errors generated during
637
        // processing of user function, and log them as part of response