Code Duplication    Length = 9-10 lines in 2 locations

src/Client.php 1 location

@@ 1118-1127 (lines=10) @@
1115
            } else {
1116
                // either system.multicall is unsupported by server,
1117
                // or call failed for some other reason.
1118
                if ($fallback) {
1119
                    // Don't try it next time...
1120
                    $this->no_multicall = true;
1121
                } else {
1122
                    if (is_a($results, '\PhpXmlRpc\Response')) {
1123
                        $result = $results;
1124
                    } else {
1125
                        $result = new Response(0, PhpXmlRpc::$xmlrpcerr['multicall_error'], PhpXmlRpc::$xmlrpcstr['multicall_error']);
1126
                    }
1127
                }
1128
            }
1129
        } else {
1130
            // override fallback, in case careless user tries to do two

src/Server.php 1 location

@@ 641-649 (lines=9) @@
638
                }
639
                if (!is_a($r, 'PhpXmlRpc\Response')) {
640
                    Logger::instance()->errorLog("XML-RPC: " . __METHOD__ . ": function '$funcName' registered as method handler does not return an xmlrpc response object but a " . gettype($r));
641
                    if (is_a($r, 'PhpXmlRpc\Value')) {
642
                        $r = new Response($r);
643
                    } else {
644
                        $r = new Response(
645
                            0,
646
                            PhpXmlRpc::$xmlrpcerr['server_error'],
647
                            PhpXmlRpc::$xmlrpcstr['server_error'] . ": function does not return xmlrpc response object"
648
                        );
649
                    }
650
                }
651
            } else {
652
                // call a 'plain php' function